FSCK(8)

NAME
fsck - check and repair a Linux file system

SYNOPSIS
fsck [ -A ] [ -V ] [ -t fstype ] [ fs-options ] filesys

DESCRIPTION
fsck is used to check and optionally repair a Linux file system. filesys is either the device name (e.g. /dev/hda1, /dev/sdb2) or the mount point (e.g. /, /usr, /home) for the file system.

The exit code returned by fsck is the sum of the following conditions:
    0    - No errors
    1    - File system errors corrected
    2    - File system errors corrected, system should
      be rebooted if file system was mounted
    4    - File system errors left uncorrected
    8    - Operational error
    16    - Usage or syntax error
    128    - Shared library error
The exit code returned when all file systems are checked using the -A option is the bit-wise OR of the exit codes for each file system that is checked.

In actuality, fsck is simply a front-end for the various file system checkers (fsck.fstype) available under Linux. The file system-specific checker is searched for in /etc/fs first, then in /etc and finally in the directories listed in the PATH environment variable. Please see the file system-specific checker manual pages for further details.

OPTIONS

-A  Walk through the /etc/fstab file and try to check all file systems in one run. This option is typically used from the /etc/rc system initalization file, instead of multiple commands for checking a single file system. Note, that with this option, you cannot give the filesys argument as well.

-V  Produce verbose output, including all file system-specific commands that are executed. Specifying this option more than once inhibits execution of any file system-specific commands. This is really only useful for testing.

-t fstype
    Specifies the type of file system to be checked. If not specified, the type is deduced by searching for filesys in /etc/fstab and using the corresponding entry. If the type can not be deduced, the default file system type (currently minix) is used.

fs-options
    File system-specific options to be passed to the real file system checker. Although not guaranteed, the following options are supported by most file system checkers.

-a  Automatically repair the file system without any questions (use this option with caution).

-l  List all the file names in the file system.

-r  Interactively repair the file system (ask for confirmations).

-s  List the super block before checking the file system.

-v  Produce verbose output.

BUGS
All generic options must precede and not be combined with file system-specific options. Some file system-specific programs do not support the -v (verbose) option, nor return meaningful exit codes.

AUTHORS
David Engel (david@ods.com)
Fred N. van Kempen (waltje@uwalt.nl.mugnet.org)
The manual page was shamelessly adapted from Remy Card's version for the ext2 file system.

SEE ALSO
mkfs(8), fsck.minix(8), fsck.ext(8), fsck.ext2(8), fsck.xiafs(8).