File space allocation/deallocation under Unix (BSD4.x)

e.a.olson eao at anumb.UUCP
Sun Jul 17 00:34:26 AEST 1988


In article <17 at tugiig> plipp at tugiig (Lipp Peter) writes:
>In article <9662 at eddie.MIT.EDU>, rich at eddie.MIT.EDU (Richard Caloggero) writes:
>>      If you create a directory "d", then create a file "d/f" 1 megabyte
>> long (big), then "rm d/f", is it true that the space remains allocated
>> to directory "d" and cannot be garbage collected or otherwise reclaimed
>> until another file is created in directory "d" or "d" is deleted?  If this is true, why?

    I believe that directory blocks are never reclaimed until
    the directory is deleted.  If you have many files in a directory,
    (i.e. more entries than can fit into a directory block), one
    entry in the first block points to another disk block for
    more name-inode entries.  Even if you later clean up that directory
    so that there are only enough entries to fit into one disk block,
    the indirect block is retained.



More information about the Comp.unix.questions mailing list