What does SIZE ON DISK mean?

  • Thread starter Thread starter Chaz
  • Start date Start date
C

Chaz

If I right click on a file, it says this:

Size: 139 KB (142,843 bytes)
Size on Disk: 140 KB (143,360 bytes)

What is the difference between the two?

Thanks in advanced!

Chaz
 
517 bytes .... sorry, couldn't resist.

The extra bytes are what it takes to store information about the
location/pointers of the file on the drive. I guess you could say the
"FAT" information.
 
On a partition, there are individual spaces called
clusters which basically identify that portion of the
disk. Only one file can be in a cluster, but a file can
span multiple clusters. Depending on the file system and
size of the partition, clusters vary widely in size from
usually 512 bytes to 8K or larger.

Since only one file can be in a cluster, a file may be
only 20 bytes long, but will take up a full cluster on
disk, or 512-8K bytes. This is why XP will not allow you
to format a partition of larger than 32 GB in the FAT32
file system, because it results in very large cluster
sizes and a lot of wasted space.

Size on disk displays how much of the disk is being
taken, as opposed to how big the file is, taking into
account cluster sizes and such.

This can also be less than the file size, for example, if
you compress the file. A compressed file may be X bytes
long uncompressed, but while compressed, it will be under
that amount on the disk.
 
Chaz said:
If I right click on a file, it says this:

Size: 139 KB (142,843 bytes)
Size on Disk: 140 KB (143,360 bytes)

What is the difference between the two?

Thanks in advanced!

Chaz

Its has to do with the way disks are formatted.
A hard drive is divided into clusters which contain
a set number of bytes. I'm using NTFS with 4096
byte clusters. So if a file is 20000 bytes long it
will take up 5 clusters. The size of file is 20000
size on disk is 20480 or 4096 * 5
It looks like your file is taking up 35 clusters.
 
In
Chaz said:
If I right click on a file, it says this:

Size: 139 KB (142,843 bytes)
Size on Disk: 140 KB (143,360 bytes)

What is the difference between the two?


Files are allocated space on your hard drive in units caled
"clusters." If you're using NTFS, you normally have 4K clusters.

So with 4K clusters, a file that's between 1 byte and 4096 bytes
in size uses one cluster, a file between 4097 and 8192 bytes uses
two clusters, and so on.

The file you cite above, 139K, uses 34 clusters plus another 3K.
But since space is allocated only in whole clusters, the size on
disk is 35 clusters.

The unused portion of that last cluster is called "slack" or
"cluster overhang." It's there on every file unless the file's
size is an exact multiple of the cluster size. The difference
between the two numbers is the amount of slack.
 
Back
Top