Comment by valleyer

14 hours ago

How do you size a directory? Just by creating entries in it and then unlinking them?

Usually the filesystem driver provides an API call that sets the appropriate data structures so that the directory entry table is preallocated.

The ext-family filesystems provide the mklost+found command to tap into this call if you need to recreate the lost+found directory specifically.

From memory mklost+found did exactly this

  • It did.

    Foxley gives the manual procedure for sizing the lost+found directory on the aforementioned page 52.

    I have the 1986 edition of Fielder's and Hunter's UNIX System Administration and it does not mention any such command in its discussion of lost+found in chapter 3. It references AT&T Unix System 5 Release 2 (or 'UNIX 5.2' as the book puts it).

    But Google Books tells me that their later 1991 update, referencing Release 4 and with an updated title to match, does indeed mention mklost+found. So that looks like something that appeared in Release 3 or 4.

    • I used to port Unix for a living (V6 thru SysVr3) I know it was in Vr2, and I have a man page that says "(last mod. 1/15/87)" which would likely make it SysVr1 or earlier

      1 reply →