next up previous

The Filesystem

This contains links to information used in the lectures.

Logical Structure

The UNIX filesystem, with symbolic links, is technically a general graph, since it can have loops. In the absence of such errors, it is an acyclic graph. Nonetheless it is still commonly referred to as a tree structure rooted at the root directory /. An important concept is the pathname, or route from / through the directory structure to a file. Terminology: Limitations:

Filesystems

Filesystems are subtrees of the directory hierarchy rooted at a particular directory called the filesystem root.

Filesystems are unmounted using the umount command. Normally you cannot unmount a busy filesystem, that is there must be no open files and no processes executing in a directory there. BSD and OSF/1 allow forcing unmounting of busy filesystem using umount -f - this is a bad idea.

Finding the processes that are preventing unmounting is a pain. There is a program lsof - list of open files - by Victor Abell of Purdue which lists them. Click here to obtain by ftp.

Organization of the Filesystem

The Unix filesystem was never well organized and has become worse as time has elapsed, with the proliferation of symbolic links. In principle, one would like files which change to be in separate locations to those which are static, but this is not the case. There are some almost standard directories.

File Types