Size on disk for small files

Status
Not open for further replies.

Sector

Cadet
Joined
Feb 3, 2014
Messages
4
I installed a few FreeNAS boxes and on all of them i see large lost space when storing small files.

For instance i have a PDF file of 48,1kB
When viewing properties i see the following:

Size: 48,1 kB (49.355 bytes)
Size on disk: 1,00 MB (1.048.576 bytes)

Or another TXT document:
Size: 78 bytes (78 bytes)
Size on disk: 1,00 MB (1.048.576 bytes)

Is this normal or did i do something wrong when configuring the volume?
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
How are you viewing the "size on disk"? CIFS & Windows Explorer?
What is your volume configuration? (output of zpool status)
 

Sector

Cadet
Joined
Feb 3, 2014
Messages
4
Yes, CIFS and file properties in Windows Explorer.


Code:
[root@NAS ~]# zpool status                                                                                                 
  pool: raid                                                                                                                       
state: ONLINE                                                                                                                     
  scan: scrub repaired 0 in 1h30m with 0 errors on Mon Feb  3 12:23:06 2014                                                       
config:                                                                                                                           
                                                                                                                                   
        NAME                                            STATE    READ WRITE CKSUM                                                 
        raid                                            ONLINE      0    0    0                                                 
          raidz2-0                                      ONLINE      0    0    0                                                 
            gptid/7279e342-89af-11e3-8365-0025902492b8  ONLINE      0    0    0                                                 
            gptid/72d0c528-89af-11e3-8365-0025902492b8  ONLINE      0    0    0                                                 
            gptid/7328d187-89af-11e3-8365-0025902492b8  ONLINE      0    0    0                                                 
            gptid/7382b7fd-89af-11e3-8365-0025902492b8  ONLINE      0    0    0                                                 
            gptid/73df84b6-89af-11e3-8365-0025902492b8  ONLINE      0    0    0                                                 
            gptid/743b4c7a-89af-11e3-8365-0025902492b8  ONLINE      0    0    0                                                 
                                                                                                                                   
errors: No known data errors 
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
Every filesystem has some overhead (and it's most noticeable with small files). However, 1MB for a tiny file is too much. The 78 byte file should consume about 8.5kB and the 48,1kB file about 56kB of the volume capacity (in your case). Windows Explorer is not be the best tool to check this. Try to run "du -h <filename>" in the FreeNAS shell to check the on disk size. du is also not perfect (e.g. it is unable to consider deduplication), but it should be OK in this case.
 

Sector

Cadet
Joined
Feb 3, 2014
Messages
4
Every filesystem has some overhead (and it's most noticeable with small files). However, 1MB for a tiny file is too much. The 78 byte file should consume about 8.5kB and the 48,1kB file about 56kB of the volume capacity (in your case). Windows Explorer is not be the best tool to check this. Try to run "du -h <filename>" in the FreeNAS shell to check the on disk size. du is also not perfect (e.g. it is unable to consider deduplication), but it should be OK in this case.


This is what i get when i check the files whit your method:

[root@NAS] /mnt/raid/Backups/test# du -h test1.pdf
8.5k test1.pdf
[root@NAS] /mnt/raid/Backups/test# du -h test2.pdf
128k test2.pdf
[root@NAS] /mnt/raid/Backups/test# du -h test3.pdf
88k test3.pdf
[root@NAS] /mnt/raid/Backups/test# du -h test4.txt
512B test4.txt

In Windows all these files are 1MB (1.048.576 bytes) on disk, even for the 512 bytes text file..

So Windows is seeing something that is not? And the space is not wasted?
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
So Windows is seeing something that is not? And the space is not wasted?
Yes, there's just too many layers where this information can get mangled. When I reproduce your situation -- 78 byte file on a 6 disk RAIDZ2 -- Windows 7 reports only 1kB on disk size. You get 1MB an the reality is actually 8.5kB.
 

Sector

Cadet
Joined
Feb 3, 2014
Messages
4
Yes, there's just too many layers where this information can get mangled. When I reproduce your situation -- 78 byte file on a 6 disk RAIDZ2 -- Windows 7 reports only 1kB on disk size. You get 1MB an the reality is actually 8.5kB.


It seems on Windows 7 that i get the correct values indeed, but on windows 8.1, its listed as 1mb per file on disk.
I got 2 machines running on Windows 8.1, whit the same issue and 1 on Windows 7 whit correct values.
So windows 8.1 is rounding it up, or maybe there is some software on te machine that is causing this.
Thanks for the advise! :)
 
Last edited:
Status
Not open for further replies.
Top