0

I have a NTFS partition, that I previously used with a Windows machine. I installed ntfs-3g as a filesystem driver in CentOS, then mounted the drive. I copy the contents (cp) to a different NTFS partition, also mounted. Now, using ll, I can see between the source and destination that some folders are 0 whereas the same folder on the other partition is (usually) 4096 bytes.

I never understood 'folder sizes'. Why does a folder have a size? And what do I lose if ls -l reports to me that the folder sizes are different between a source and a backup (but files and file contents are without differences)?

Florian Mertens
  • 413
  • 4
  • 10

1 Answers1

0

I never understood 'folder sizes'. Why does a folder have a size?

Because it needs space to store the metadata, the names of the contained files and the references / pointers to the said files.

This being said, the reported directory size is just implementation specifics of the file system module - in your case ntfs-3g. It might or might not correspond to the on-disk size of data.

I would hazard a guess that a folder small enough to fit into the MFT entry as "resident data" is reported as zero-sized while a folder using up an own cluster is reported as being cluster-sized, thus 4k.

Unless ntfs-3g is broken, you are not losing data, although if you have used cp to copy the files, you have lost (at least some of) the NTFS ACLs present on your source.

the-wabbit
  • 40,737
  • 13
  • 111
  • 174