[TUHS] moving directories in svr2

Dan Cross crossd at gmail.com
Thu Dec 30 06:58:10 AEST 2021


Partitioning the tree sure seems like it would lead to a bad day, doesn't it?

I expect the undocumented arcana related to linking directories was
always an escape hatch for a skilled administrator to rescue a sick
system. One can imagine any number of ways in which directory files
could be corrupted; sufficient inspection of disk contents might give
someone with the requisite low-level knowledge sufficient information
that they could, say, reattach a pruned subtree with clever uses of
`ln -f` and `unlink`. Did `icheck` and friends have something
analogous to the `lost+found` directory created by `fsck`? I could
imagine (somewhat painfully) executing those commands while in
single-user mode on the console.

        - Dan C.

On Wed, Dec 29, 2021 at 3:42 PM Richard Salz <rich.salz at gmail.com> wrote:
>
> https://dsf.berkeley.edu/cs262/unix.pdf section 3.2 ends with:
>
> Each directory always has at least two entries. The
> name "." in each directory refers to the directory itself. Thus a
> program may read the current directory under the name “.”
> without knowing its complete path name. The name “..” by
> convention refers to the parent of the directory in which it
> appears, that is, to the directory in which it was created.
> The directory structure is constrained to have the form
> of a rooted tree. Except for the special entries “.” and “..”,
> each directory must appear as an entry in exactly one other,
> which is its parent. The reason for this is to simplify the
> writing of programs which visit subtrees of the directory
> structure, and more important, to avoid the separation of
> portions of the hierarchy. If arbitrary links to directories
> were permitted, it would be quite difficult to detect when
> the last connection from the root to a directory was severed


More information about the TUHS mailing list