Free Block Checking; Checking The Inode State; Inode Links - Sun Microsystems Sun Workstation 100U System Manager's Manual

Table of Contents

Advertisement

Fsck - UNIX File System Checker
Fixing Corrupted File Systems
2.3. Free Block Checking
F ,ek checks that all the blocks marked as free in the cylinder group block maps are not claimed
by any files. When all the blocks have been initially accounted for, "ek checks that the number
of free blocks plus the number of blocks claimed by the inodes equals the total number of blocks
in the file system.
If anything is wrong with the block allocation maps, "ek will rebuild them, based on the list it
has computed of allocated blocks.
The summary information associated with the super-block counts the total number of free
blocks within the file system. F,ek compares this count to the number of free blocks it found
within the file system. If the two counts do not agree, then f,ek replaces the incorrect count in
the summary information by the actual free-block count.
The summary information counts the total number of free inodes within the file system. F,ek
compares this count to the number or rree inodes it round within the file system. If the two
counts do not agree, then f,ek replaces the incorrect count in the summary information by the
actual free-inode count.
2.4. Checking the Inode State
An individual inode is not as likely to be corrupted as the allocation information. However,
because of the great number of active inodes, a few or the inodes are usually corrupted.
The list of inodes in the file system is checked sequentially starting with inode
2
(inode
0
marks
unused inodes; inode 1 is saved for future generations) and progressing through the last inode in
the file system. The state of each inode is checked for inconsistencies involving format and
type, link count, duplicate blocks, bad blocks, and inode size.
Each inode contains a mode word. This mode word describes the type and state of the inode.
Inodes must be one of six types: regular inode, directory inode, symbolic link inode, special
block inode, special character inode, or socket inode. Inodes may
be
found in one of three allo-
cation states: unallocated, allocated, and neither unallocated nor allocated. This last state sug-
gests an incorrectly formated inode. An inode can get in this state if bad data is written into
the inode list. The only possible corrective action is for f,ek is to clear the inode.
2.5. Inode Links
Each inode counts the total number of directory entries linked to the inode. F,ek verifies the
link count of each inode by starting at the root of the file system, and descending through the
directory structure. The actual link count for each inode is calculated during the descent.
If the stored link count is non-zero and the actual link count is zero, then no directory entry
appears for the inode. If this happens, f,ek will place the disconnected file in the lo,t+ found
directory. If the stored and actual link counts are non-zero and unequal, a directory entry may
have been added or removed without the inode being updated. If this happens, f,ek replaces
the incorrect stored link count by the actual link count.
Each inode contains a list, or pointers to lists (indirect blocks), or all the blocks claimed by the
inode. Since indirect blocks are owned by an inode, inconsistencies in indirect blocks directly
affect the inode that owns it.
F,ek compares each block number claimed by an inode against a list or already allocated blocks.
If another inode already claims a block number, then the block number is added to a list or
28 July 1983
5

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sun workstation 150u

Table of Contents