Each phase compares components and checks that
these components agree with each other.
Phase 1
fsck reads the map of filesystem inodes
(inode bitmap) and initializes the map of filesystem blocks
(block bitmap).
Phase 2
fsck reads the inodes and validates them.
DTFS files are managed through a structure known as
a ``B+ tree''.
The tree consists of disk block addresses that point either to
intermediate blocks (known as ``interior nodes'') or to
the actual user data blocks (referred to as ``leaf nodes'').
This tree structure is normally balanced (the distance from top
level to leaf is the same for all paths in the tree). fsck
verifies the parent inodes and rebalances any inodes (trees) that
have become unbalanced.
Phase 3
fsck rebuilds the directory hierarchy.
Because DTFS inodes contain the
inode number of the parent directory and the inode filename,
reconstruction is much easier and requires no lost+found directory.
If any inodes that cannot be reconnected or contain
invalid data (bad inodes) are found, the inode bitmap is updated.
The block bitmap is then updated.
Phase 4
fsck updates information in the superblock.
For a complete list of error messages, see the
fsck(ADM)
manual page.