Cluster/allocation/file size

Status
Not open for further replies.

wornall1026

Cadet
Joined
Jan 5, 2017
Messages
2
ZFS newbie. I have a ZFS volume that has a lot of tiny files, and another with 4GB+ files. I want to tune the cluster size so that a 1k file only takes up 1k on the disk. I created a ZFS volume using the defaults for volume creation. I can now 'touch' 10 empty files (CLI of freenas server), then go to my windows box where this volume is shared to, select properties, and it says 10 files, 0 bytes, size on disk: 10MB. Given the large number of small files I have, I keep running out of disk space with only a small amount of data.

I have read that ZFS customizes block sizes automatically. I've also noticed that creating a dataset in the advanced mode will allow me to change the record size, however neither of these change the results of the test above.

If it were a windows server i would just format with a 1k allocation size, or on linux box, do mke2fs -b 1024. What do i do with ZFS?
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Have you checked out the "recordsize" parameter? And I found a few other things using Google search. I honestly don't know if you can change this because the drive is likely a true 4K cluster size. I understand you are trying to save of wasted space but also keep in mind that when you create more clusters becasue you are lowering your cluster size, you will create a larger File Allocation Table (FAT) which might offset the smaller clusters.

I would be curious what you find out.
 

MrToddsFriends

Documentation Browser
Joined
Jan 12, 2015
Messages
1,338
I can now 'touch' 10 empty files (CLI of freenas server), then go to my windows box where this volume is shared to, select properties, and it says 10 files, 0 bytes, size on disk: 10MB. Given the large number of small files I have, I keep running out of disk space with only a small amount of data.

Windows apparently does some rounding up depending on the Windows version, apart from block size and real disk usage.
https://forums.freenas.org/index.php?threads/size-on-disk-for-small-files.18149/

In Windows 10 explorer I see 1MB "size on disk" per empty file.
 

wornall1026

Cadet
Joined
Jan 5, 2017
Messages
2
That's it exactly. I did the same test on a Windows2000 computer and it says 0 bytes, size on disk: 0 bytes. when I put a few bytes into three of the files, then it reports "size on disk" is 3k.
 
Status
Not open for further replies.
Top