File size versus ‘Size on Disk’

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

File size versus ‘Size on Disk’

In Windows, the size of a file and its size on disk are two different measures, so when you examine file properties, they will usually be different, and the size on disk value will be higher. When it comes to movie playback load in Delta, the first step is reading the video frames from disk, so it’s the ‘Size on Disk’ that matters first for performance considerations. ‘Size on Disk’ is of course what’s pertinent to storage capacity planning as well.

Windows File Explorer: list and file properties

In Windows File Explorer the requirement is to show disk space and allocation, not the data size of files per se. If you want to know that, the file properties will tell you. Note the indicated size units when comparing the list sizes with the file properties dialog which may be showing different units. Remember that 1 MB = 1024 KB (likewise, 1 KB = 1024 B and 1TB = 1024 MB).

file-explorer-sizes

In the file properties, there are two further file sizes, each typically expressed in MB and Bytes. So in the example above, the KB list value 6,076 × 1024 = 6,221,824 bytes in the ‘size on disk’ in properties. Similarly 6,076 KB ÷ 1024 = 5.93 MB.

In rounded MB values, they may look the same, as here, but the bytes values show there is a difference.

Size and Size on Disk

A disk is divided into tracks divided into sectors. Groups of sectors comprise ‘disk allocation units’ or ‘clusters’ of fixed sizes. Files occupy as many clusters as required, and a cluster cannot be shared between files. Therefore a file will most likely leave a cluster incompletely filled. Its space on disk is therefore bigger than its actual data size. The larger the cluster size, the more ‘wasted’ space there will be. Even if a single byte spills over into a new cluster, the whole of that cluster is registered to the file.

When the file is read from disk, it is the disk that is being interrogated: which clusters contain parts of this file? So we read clusters, full or partly empty, and the multiple of cluster sizes is the required bandwidth.

How big are my disk clusters (allocation units)?

The size of a cluster can vary, but typical ranges are from 512 B to 32 KB or more. For example, on your C:\ drive, the allocation unit may be 4096 bytes. This means that Windows will allocate 4096 bytes for any file or portion of a file that is from 1 to 4096 bytes in length. You can find your NTFS cluster size from the elevated CMD prompt:

fsutil fsinfo ntfsinfo C:

Click for a larger image

Or from an elevated PowerShell window:

Get-Volume -DriveLetter C | Format-List

Click for a larger image

Or if you want cluster sizes available per file system or disk volume, then use the diskpart command in an elevated CMD window:

Click for a larger image