NAME | SYNOPSIS | DESCRIPTION | DIAGNOSTICS | ATTRIBUTES | SEE ALSO
fsck is a target utility.
The fsck command audits and interactively repairs inconsistent conditions for filesystems. If the filesystem is inconsistent, the operator is prompted for concurrence before each correction is attempted.
The following flags are interpreted by fsck:
Use the block specified immediately after the flag as the super block for the filesystem. Block 32 is usually an alternate super block.
Force fsck to check `clean' filesystems when preening.
Use the mode specified in octal immediately after the flag as the permission bits to use when creating the lost+found directory rather than the default 1777. In particular, systems that do not wish to have lost files accessible by all users on the system should use a more restrictive set of permissions such as 700.
Preen filesystems (see above).
Assume a yes response to all questions asked by fsck. This should be used with great caution, as it fis a license to continue after major problems have been encountered.
Assume a no response to all questions asked by fsck except for CONTINUE?, which is assumed to be affirmative; do not open the filesystem for writing.
Inconsistencies checked are as follows:
Blocks claimed by more than one inode or the free map;
Blocks claimed by an inode outside the range of the filesystem;
Incorrect link counts.
The only inconsistencies that fsck with the -p option will correct are:
If it encounters other inconsistencies, it exits with an abnormal return status and an automatic reboot will then fail. For each corrected inconsistency one or more lines will be printed identifying the filesystem on which the correction will take place, and the nature of the correction. After successfully correcting a filesystem, fsck will print the number of files on that filesystem, the number of used and free blocks, and the percentage of fragmentation.
Size checks:
Directory size not a multiple of DIRBLKSIZ;
Partially truncated file;
Bad inode format;
Blocks not accounted for anywhere.
Directory checks:
File pointing to unallocated inode;
Inode number out of range;
Dot or dot-dot are not the first two entries of a directory or have the wrong inode number.
Super Block checks:
More blocks for inodes than there are in the filesystem;
Bad free block map format;
Total free block and/or free inode count incorrect.
The diagnostics produced by fsck are fully enumerated and explained in Appendix A of Fsck - The UNIX File System Check Program.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | DESCRIPTION | DIAGNOSTICS | ATTRIBUTES | SEE ALSO