Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

file

size

ntfs

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

like image 614
Parad0x13 Avatar asked Oct 20 '25 07:10

Parad0x13


1 Answers

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

like image 157
Robert Goldwein Avatar answered Oct 22 '25 04:10

Robert Goldwein



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!