4.14. File Systems
To appreciate the concept of links to a file, we need a conceptual understanding of the structure of the UNIX file system. Understanding the difference between an i-node and a directory entry that points to an i-node is also useful.Various implementations of the UNIX file system are in use today. Solaris, for example, supports several different types of disk file systems: the traditional BSD-derived UNIX file system (called UFS), a file system (called PCFS) to read and write DOS-formatted diskettes, and a file system (called HSFS) to read CD file systems. We saw one difference between file system types in Figure 2.19. UFS is based on the Berkeley fast file system, which we describe in this section.We can think of a disk drive being divided into one or more partitions. Each partition can contain a file system, as shown in Figure 4.13.
Figure 4.13. Disk drive, partitions, and a file system
[View full size image]

Figure 4.14. Cylinder group's i-nodes and data blocks in more detail
Section 2.5.2 that the POSIX.1 constant LINK_MAX specifies the maximum value for a file's link count.
The file type in the i-node would be S_IFLNK so that the system knows that this is a symbolic link.
lrwxrwxrwx 1 root 7 Sep 25 07:14 lib -> usr/lib
We've talked about the concept of a link count for a regular file, but what about the link count field for a directory? Assume that we make a new directory in the working directory, as in
Figure 4.15 shows the result. Note that in this figure, we explicitly show the entries for dot and dot-dot.
$ mkdir testdir
Figure 4.15. Sample cylinder group after creating the directory testdir
Chapter 4 of Bach [1986]. Refer to Chapter 7 of McKusick et al. [1996] or Chapter 8 of McKusick and Neville-Neil [2005] for additional information on the changes made with the Berkeley fast file system. See Chapter 14 of Mauro and McDougall [2001] for details on UFS, the Solaris version of the Berkeley fast file system.
