Size vs Size on Disk

  • Thread starter Thread starter gusmeister
  • Start date Start date
G

gusmeister

When you right-click on a folder and choose Properties, you can see the Size
and the Size on Disk of the folders contents. I can understand that the two
are not identical (due to data alignment along disk sectors, etc) but the
discrepancy is sometimes huge. Why would a 350MB folder take up 500MB on
disk?
 
gusmeister said:
When you right-click on a folder and choose Properties, you can see the Size
and the Size on Disk of the folders contents. I can understand that the two
are not identical (due to data alignment along disk sectors, etc) but the
discrepancy is sometimes huge. Why would a 350MB folder take up 500MB on
disk?

When dealing with folders, there is some unusable space at the and of every
file, unless it fills an entire cluster, so each FILE will have some unused
space. A folder with hundreds of files in it will do that.
 
In
gusmeister said:
When you right-click on a folder and choose Properties, you can see
the Size and the Size on Disk of the folders contents. I can
understand that the two are not identical (due to data alignment
along disk sectors, etc) but the discrepancy is sometimes huge. Why
would a 350MB folder take up 500MB on disk?


Files are allocated space in units called "clusters." The size of
a cluster varies depending on the file system used, and perhaps
on the size of the partition, but if you're using NTFS, you
probably have 4K clusters. That means that a file between one
byte and 4096 bytes (size) takes up one cluster (size on disk), a
file between 4097 and 8192 bytes takes two clusters and so on.
Except for files that are an exact multiple of the cluster size,
a portion of the last cluster is always wasted. That wasted space
is called "slack." The difference between size and size on disk
is slack. In your example, you have 150MB of slack.

Assuming that the average file ends its last cluster in the
middle (actually not a completely valid assumption, but close
enough for our purposes), each file wastes half a cluster on
average. If you are using NTFS, it would take 75,000 files
wasting 2K each in the folder you described, so my guess is that
you're using FAT32 and have 32K clusters; that would be around
5,000 files in the folder.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top