Why different directory sizes?

Theodore Tso tytso at mit.edu
Wed May 10 11:17:26 UTC 2006


On Wed, May 10, 2006 at 12:35:36PM +0200, Felix E. Klee wrote:
> I just discovered two directories with the same number of files and the same 
> number of hard links but different size:
>
> What could be the reason for the different sizes?  They confuse our backup 
> script.

The reason is history.  Like many Unix filesystems, ext3 doesn't
garbage collect empty blocks in a directory.  So if you create a lot
of files in a directory, and then delete them all, the directory
doesn't shrink in size.  In practice this isn't a problem, so we've
never bothered to fix it.  

Why should your backup script care?  It really shouldn't....

						 - Ted




More information about the Ext3-users mailing list