DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Managing the VxFS filesystem

Full VxFS fsck

A full filesystem check is generally not necessary unless there has been some sort of disk hardware failure. When a full filesystem check is required, the following command line is commonly used:

fsck -F vxfs -o full -y special

Four passes through the filesystem are performed as part of full filesystem check:

  1. Check inode sanity (see ``Full filesystem check: pass 1'').

    This checks for bad or duplicate extent references. For Version 2 and Version 4 layout filesystems, additional checking is performed for inodes that contain structural data for the filesystem.

  2. Check directory entries. (see ``Full filesystem check: pass 2'').

    This checks and verifies directory entries.

  3. Check link counts of files (see ``Full filesystem check: pass 3'').

    This checks that no files in the filesystem are ``orphaned.''

  4. Check free inode maps, free extent maps, and superblock counts (see ``Full filesystem check: pass 4'').


NOTE: With the exception of the preliminary pass at the beginning of Pass 1, all passes apply to Version 1, Version 2, and Version 4 layout filesystems.

Full filesystem check: pass 1

For a Version 2 or Version 4 layout filesystem, a full filesystem check performs a preliminary pass on file objects unique to this layout (such as structural files in the attribute fileset). Version 1, and Version 2, and Version 4 layout filesystems undergo a set of standard Pass 1 functions. The preliminary pass occurs before the standard set of Pass 1 functions for a Version 2 or Version 4 filesystem and not at all for a Version 1 filesystem. These passes are similar, but operate on different objects.

The Version 2 and Version 4 preliminary pass performs the following functions:

  1. Performs sanity checking on inodes in the attribute fileset to ensure that they have proper modes, link counts, matching inodes (for replicated files), file sizes, and extent allocation information. If the file fails any of these checks, it is considered to be bad. Bad inodes can result in a filesystem that cannot be repaired if both copies of the inode list are destroyed, for instance.

  2. Checks all extents allocated to the file to ensure that blocks are valid and that only certain file types (inode list files) contain duplicate blocks.

  3. Rechecks the file size information and records block allocations for the file.

  4. Updates the Link Count Table (LCT) entries for the inodes associated with structural elements of the filesystem.

Pass 1 performs the following functions:

  1. Performs basic inode sanity checks on the files to ensure that the mode, link count, file size, extent allocation information, and extended inode operation information are valid. If the basic information is invalid, the file is considered to be bad.

  2. Checks all extents allocated to the file to ensure that all references are to valid block numbers, and that blocks are not allocated to multiple files.

  3. Rechecks the basic file size information to ensure that the file size and extents allocated to the file are in agreement.

  4. Updates link counts for inodes.


CAUTION: If an inode fails sanity checking, it should be removed.

If it is essential to save an inode, (for example, when an irreplaceable file might be lost), select the q (quit) option, use fsdb(ADM) to attempt to fix the problem, and recheck the filesystem with fsck. Unless you are extremely experienced in filesystem debugging, this procedure is not recommended.

Unless fsck is being run with the -n option, answering no to any of the questions asked by fsck can be extremely dangerous to filesystem integrity.


Full filesystem check: pass 2

Pass 2 performs the following functions:

  1. Checks directory entries to ensure that they have valid inode numbers and valid file names.

  2. If a directory has subdirectories, checks the ``i_dotdot'' field of each subdirectory to ensure that it acknowledges the referencing directory as its parent.

  3. Validates free space counts and hash chains in the directory block.

Some inconsistencies cause entire directory blocks to be considered invalid (for example, if data in the directory is invalid or has become corrupted). Other inconsistencies are treated as minor and cause directory blocks to be updated but retained.

If a directory or directory block is considered to be invalid and gets cleared, any files originally referenced by the directory or directory block will no longer be referenced. In this situation, Pass 3 reports unreferenced files, or files with invalid link counts.

Full filesystem check: pass 3

Pass 3 performs the following functions:

  1. Checks that all files are referenced by directories.

  2. Checks that all ``dot-dot'' (..) paths from directories lead back to the root inode of the filesystem.

  3. Checks that the link counts of files are correct.

  4. Checks the link counts on all files in the attribute fileset's link count table. (Version 2 layout only).
If a file is not referenced, or the ``..'' path does not lead back to the root inode, the file must be attached to the lost+found directory, or removed.

Full filesystem check: pass 4

Pass 4 performs the following functions:

  1. Checks that the free inode maps on disk agree with the filesystem as it was found or reconstructed.

  2. Checks that the free extent maps agree with extents allocated to files.

  3. Checks that the allocation unit summaries match the counts of free inodes and extents.

  4. Clears the intent log to ensure the log is accessible and in a known state.

  5. Checks that superblock free counts agree with actual free inodes and extents.

  6. Marks the filesystem as ready to mount so that it can be mounted.

Previous topic: fsck_vxfs intent log replay

© 2007 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 05 June 2007