fsck audits and interactively repairs inconsistent conditions on file systems. A file system to be checked may be specified by giving the name of the block or character special device or by giving the name of its mount point if a matching entry exists in /etc/vfstab. If no special device is specified, all s5 file systems specified in the vfstab with a fsckdev entry will be checked.
In the case of correcting serious inconsistencies, by default, fsck asks for confirmation before making a repair and waits for the operator to respond either yes or no. If the operator does not have write permission on the file system, fsck will default to a -n (no corrections) action. See fsck(1M).
Repairing some file system inconsistencies may result in loss of data. The amount and severity of data loss may be determined from the diagnostic output.
fsck automatically corrects innocuous inconsistencies such as unreferenced inodes, missing blocks in the free list, blocks appearing in the free list and also in files, or incorrect counts in the superblock automatically. It displays a message for each inconsistency corrected that identifies the nature of the correction on which the file system took place. After successfully correcting a file system, fsck prints the number of files on that file system and the number of used and free blocks.
Inconsistencies checked are as follows:
Blocks claimed by more than one inode or the free list.
Blocks claimed by an inode or the free list outside the range of the file system.
Incorrect link counts.
Incorrect directory sizes.
Bad inode format.
Blocks not accounted for anywhere.
Directory checks, file pointing to unallocated inode, inode number out of range, absence of `.' and `. .' entries in any directory.
Superblock checks: more blocks for inodes than there are in the file system.
Bad free block list format.
Total free block and/or free inode count incorrect.
Orphaned files and directories (allocated but unreferenced) are, with the operator's concurrence, reconnected by placing them in the lost+found directory. The name assigned is the inode number. If the lost+found directory does not exist, it is created.
See generic fsck(1M) for generic_options and details for specifying special.
Fast check; duplicate blocks and free list check only.
After all other output is done, print i-number/pathname correspondences for damaged files.
If there is insufficient memory and a temporary file is necessary to complete file system checking, use scratchfile as the temporary file.
Same as above.
If it is necessary to rewrite (salvage) the free block list to correct an inconsistency, interleave the blocks such that, to the extent possible within each group of cyl consecutive free blocks, the interval between blocks is skip. For example, with an interleave of 8:3, in each group of eight consecutive free blocks, the order on the free list would be 1 4 7 2 5 8 3 6. If no cyl:skip is given, the value is either taken from the superblock, or, if unspecified (either has a value of 0), 400:7 is used. For obscure historical reasons, interleave specification of ``3'' and ``4'' (without colons) are taken to mean 200:5 and 418:7, respectively.
Same as above, except rewrite the free block list unconditionally.
Quiet; produce less verbose output.
Perform more extensive directory checking than normal.
(``preen'') Check and fix the file system non-interactively. Exit immediately if there is a problem requiring intervention.
Print usage message.
See attributes(5) for descriptions of the following attributes:
|ATTRIBUTE TYPE||ATTRIBUTE VALUE|
It is usually faster to check the character special device than the block special device.