A UFS file system is made of:
Block 1 that contains:
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
List of free inodes
Inode blocks and, for assigned inodes:
File type: regular, device, named pipes, socket, symbolic link
File owner: UID and GID
Protection information: rwe for ugo
Link count: name and inode of master file
Size of the file in bytes
Last file access date
Last file modification date
Last inode modification date
Pointers to data blocks: actual location of blocks on physical disk
Data blocks with user data or system files
The superblock is followed by blocks containing inodes and associated
inumber pairs. An inode describes an individual file with one inode
for each file in the file system. For each file system is allocated a maximum
number of inodes and therefore a maximum number of files. The maximum values
depend on the the file system size.
Inode 1 on each file system is unnamed and unused. Inode 2 must correspond to the file system root directory that supports all other files in the file system. Inodes after inode 2 are free and can be any file. Inodes and blocks are not allocated in any particular order.
A directory entry, file or link, consists of the name and the
inumber representing the file. The link count indicates the number of
directory entries that refer to the same file. A file is deleted if the link
count is zero. When the file is deleted the associated inode is returned to the
free-inode list and its associated blocks are returned to the
free-block list.