Installation guide
A UFS file system has four major parts:
• Boot block
The first block of every file system (block 0) is reserved for a boot, or
initialization, program.
• Superblock
Block 1 of every file system is called the superblock and contains the
following information:
– Total size of the file system (in blocks)
– Number of blocks reserved for inodes
– Name of the file system
– Device identification
– Date of the last superblock update
– Head of the free-block list, which contains all of the free blocks (the
blocks available for allocation) in the file system
When new blocks are allocated to a file, they are obtained from the
free-block list. When a file is deleted, its blocks are returned to the
free-block list.
– List of free inodes, which is the partial listing of inodes available to
be allocated to newly created files
• Inode blocks
A group of blocks follows the superblock. Each of these blocks contains
a number of inodes. Each inode has an associated inumber. An inode
describes an individual file in the file system. There is one inode for
each possible file in the file system. File systems have a maximum
number of inodes; therefore there is a maximum number of files that a
file system can contain. The maximum number of inodes depends on
the size of the file system.
The first inode (inode 1) on each file system is unnamed and unused.
The second inode (inode 2) must correspond to the root directory for the
file system. All other files in the file system are under the file system’s
root directory. After inode 2, you can assign any inode to any file. You
can also assign any data block to any file. The inodes and blocks are not
allocated in any particular order.
If an inode is assigned to a file, the inode can contain the following
information:
– File type
The possible types are regular, device, named pipes, socket, and
symbolic link files.
Administering the UNIX File System 7–7