Search code examples
filesizentfs

How can a folder size be larger than it's size on disk?


I have this interesting test case where I generated thousands and thousands of very small files. As you might imagine the size on disk grew linearly but I did not expect that the size on disk would be less than the size of the entire folder. (NTFS)

I understand how the size on disk can be greater than the size, but I'm confused as to how it could be smaller.

I'm not exactly sure how this is possible. Any clues?

enter image description here


Solution

  • It can be either the compression, or see sparse files.

    But in your case, I'd guess that's the third option - if the file is small, usually under 400 bytes, its data can fit into MFT File Record, so it doesn't occupy any cluster. You have ~30.000 files, so if they are approximately 300 bytes each, it can be 9 MB and still it would count as 0 bytes on disk: enter image description here