3
1
I've read a couple posts explaining that when you have many small files, the "size on disk" reported by windows can be much larger than the reported "size". This makes good sense to me, but from what I can tell, the "cluster size" or "allocation unit" is typically 4 kB, which (if I understand the argument right) means that a single file should not be more than 4 kB bigger in the "size on disk" metric.
I have a tiff image that is reportedly 65 kB in "size", but 1.00 MB when measured as "size on disk". What could the cause of this big discrepancy be?
Update: I realize now that the file is on a NAS drive that runs Linux. I checked the allocation unit size and it is just 4 kB, not 1 MB, for example:
bash-3.2# /sbin/blockdev --getbsz /dev/sda1
4096
I also checked a file that has "size" 1 kB and it shows up as 1.00 MB under "size on disk".
2
blockdev
shows block size of the block device not the file system. For example if you have ext2 to ext4 you can see the file system block size using:tune2fs -l /dev/sda1 | grep -i size:
. ------ How did you check "size on disk" on Linux? You can use:ls --block-size=1 -s filename
ordu --block-size=1 filename
. – pabouk – 2014-09-16T09:38:40.903I have done some tests between WinXP and Ubuntu, and proved that Windows gets it wrong. In my case it was rounding the size to a multiple of 1024 bytes instead of 4096, but different Windows and Linux network drivers could easily show your observation. The Linux command
du --block-size 1 ...
showed the expected multiple of 4096, so that is the command to believe. If you copy the file on to a Windows directory, you should not see the huge discrepancy. – AFH – 2014-09-16T12:41:32.483