Fsck − The unix† File System Check Program



Download 52.5 Kb.
View original pdf
Page11/49
Date14.07.2018
Size52.5 Kb.
1   ...   7   8   9   10   11   12   13   14   ...   49
3.5. Inode links
Each inode counts the total number of directory entries linked to the inode. Fsck 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 nonzero and the actual link count is zero, then no directory entry appears for the inode. If this happens, fsck will place the disconnected file in the lost+found directory. If the stored and actual link counts are nonzero and unequal, a directory entry may have been added or removed without the inode being updated. If this happens, fsck replaces the incorrect stored link count by the actual link count.
Each inode contains a list, or pointers to lists (indirect blocks, of 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.
Fsck compares each block number claimed by an inode against a list of already allocated blocks. If another inode already claims a block number, then the block number is added to a list of duplicate blocks.
Otherwise, the list of allocated blocks is updated to include the block number.
If there are any duplicate blocks, fsck will perform a partial second pass over the inode list to find the inode of the duplicated block. The second pass is needed, since without examining the files associated with these inodes for correct content, not enough information is available to determine which inode is corrupted and should be cleared. If this condition does arise (only hardware failure will cause it, then the inode with the earliest modify time is usually incorrect, and should be cleared. If this happens, fsck prompts the operator to clear both inodes. The operator must decide which one should be kept and which one should be cleared.

1   ...   7   8   9   10   11   12   13   14   ...   49


The database is protected by copyright ©userg.info 2017
send message

    Main page

bosch
camera
chevrolet
epson
fiat
Harley Davidson
Honda
iphone
mitsubishi
nissan
Panasonic
Sony
volvo
xiaomi
Xperia
yamaha