.SH SYNOPSIS
.B fsck
[
-.B \-sACVRTNP
+.B \-sAVRTMNP
+]
+[
+.B \-C
+[
+.I fd
+]
]
[
.B \-t
.I fstype
-] [\-\-] [
-.B fsck-options
+]
+.I [filesys ... ]
+[\-\-] [
+.B fs-specific-options
]
-.I filesys [ ... ]
.SH DESCRIPTION
.B fsck
-is used to check and optionally repair a one or more Linux file systems.
+is used to check and optionally repair one or more Linux file systems.
.I filesys
can be a device name (e.g.
.IR /dev/hdc1 ", " /dev/sdb2 ),
.IR / ", " /usr ", " /home ),
or an ext2 label or UUID specifier (e.g.
UUID=8868abf6-88c5-4a83-98b8-bfc24057f7bd or LABEL=root).
-The
+Normally, the
.B fsck
-program will try to run filesystems on different physical disk drives
-in parallel to reduce total amount time to check all of the filesystems.
+program will try to handle filesystems on different physical disk drives
+in parallel to reduce the total amount of time needed to check all of the
+filesystems.
+.PP
+If no filesystems are specified on the command line, and the
+.B \-A
+option is not specified,
+.B fsck
+will default to checking filesystems in
+.B /etc/fstab
+serially. This is equivalent to the
+.B \-As
+options.
.PP
The exit code returned by
.B fsck
.br
\ 16\ \-\ Usage or syntax error
.br
+\ 32\ \-\ Fsck canceled by user request
+.br
\ 128\ \-\ Shared library error
.br
-The exit code returned when all file systems are checked using the
-.B \-A
-option is the bit-wise OR of the exit codes for each
+The exit code returned when multiple file systems are checked
+is the bit-wise OR of the exit codes for each
file system that is checked.
.PP
In actuality,
.B \-s
Serialize
.B fsck
-operations. This is a good idea if you checking multiple
+operations. This is a good idea if you are checking multiple
filesystems and the checkers are in an interactive mode. (Note:
.BR e2fsck (8)
runs in an interactive mode by default. To make
.B \-n
option if you do not.)
.TP
-.BI \-t " fstype"
-Specifies the type of file system to be checked. When the
+.BI \-t " fslist"
+Specifies the type(s) of file system to be checked. When the
.B \-A
flag is specified, only filesystems that match
-.I fstype
-are checked. If
-.I fstype
-is prefixed with
-.I no
-then only filesystems whose type does not match
-.I fstype
-are checked.
+.I fslist
+are checked. The
+.I fslist
+parameter is a comma-separated list of filesystems and options
+specifiers. All of the filesystems in this comma-separated list may be
+prefixed by a negation operator
+.RB ' no '
+or
+.RB ' ! ',
+which requests that only those filesystems not listed in
+.I fslist
+will be checked. If all of the filesystems in
+.I fslist
+are not prefixed by a negation operator, then only those filesystems
+listed
+in
+.I fslist
+will be checked.
+.sp
+Options specifiers may be included in the comma-separated
+.IR fslist .
+They must have the format
+.BI opts= fs-option\fR.
+If an options specifier is present, then only filesystems which contain
+.I fs-option
+in their mount options field of
+.B /etc/fstab
+will be checked. If the options specifier is prefixed by a negation
+operator, then only
+those filesystems that do not have
+.I fs-option
+in their mount options field of
+.B /etc/fstab
+will be checked.
+.sp
+For example, if
+.B opts=ro
+appears in
+.IR fslist ,
+then only filesystems listed in
+.B /etc/fstab
+with the
+.B ro
+option will be checked.
+.sp
+For compatibility with Mandrake distributions whose boot scripts
+depend upon an unauthorized UI change to the
+.B fsck
+program, if a filesystem type of
+.B loop
+is found in
+.IR fslist ,
+it is treated as if
+.B opts=loop
+were specified as an argument to the
+.B \-t
+option.
.sp
Normally, the filesystem type is deduced by searching for
.I filesys
in the
.I /etc/fstab
file and using the corresponding entry.
-If the type can not be deduced,
+If the type can not be deduced, and there is only a single filesystem
+given as an argument to the
+.B \-t
+option,
.B fsck
-will use the type specified by the
-.B \-t
-option if it specifies a unique filesystem type. If this type is not
+will use the specified filesystem type. If this type is not
available, then the default file system type (currently ext2) is used.
.TP
.B \-A
file and try to check all file systems in one run. This option is
typically used from the
.I /etc/rc
-system initalization file, instead of multiple commands for checking
+system initialization file, instead of multiple commands for checking
a single file system.
.sp
The root filesystem will be checked first unless the
file.
Filesystems with a
.I fs_passno
-value of 0 are skipped and are not checked at all.
+value of 0 are skipped and are not checked at all. Filesystems with a
+.I fs_passno
+value of greater than zero will be checked in order,
+with filesystems with the lowest
+.I fs_passno
+number being checked first.
If there are multiple filesystems with the same pass number,
-e2fsck will attempt to check them in parallel, although it will avoid running
+fsck will attempt to check them in parallel, although it will avoid running
multiple filesystem checks on the same physical disk.
-Hence,
-a very common configuration in
+.sp
+Hence, a very common configuration in
.I /etc/fstab
files is to set the root filesystem to have a
.I fs_passno
value of 1
-and to set all filesystems to have a
+and to set all other filesystems to have a
.I fs_passno
value of 2. This will allow
.B fsck
to automatically run filesystem checkers in parallel if it is advantageous
to do so. System administrators might choose
-not to use this configuration if they need to avoid multiple filesystem
+not to use this configuration if they need to avoid multiple filesystem
checks running in parallel for some reason --- for example, if the
machine in question is short on memory so that
excessive paging is a concern.
.TP
-.B \-C
-Display completion/progress bars for those filesystems checkers (currently
-only for ext2) which support them. Fsck will manage the filesystem checkers
-so that only one of them will display a progress bar at a time.
+.B \-C\fR [ \fI "fd" \fR ]
+Display completion/progress bars for those filesystem checkers (currently
+only for ext2 and ext3) which support them. Fsck will manage the
+filesystem checkers so that only one of them will display
+a progress bar at a time. GUI front-ends may specify a file descriptor
+.IR fd ,
+in which case the progress bar information will be sent to that file descriptor.
+.TP
+.B \-M
+Do not check mounted filesystems and return an exit code of 0
+for mounted filesystems.
.TP
.B \-N
Don't execute, just show what would be done.
Produce verbose output, including all file system-specific commands
that are executed.
.TP
-.B fsck-options
-Options which which are not understood by
+.B fs-specific-options
+Options which are not understood by
.B fsck
are passed to the filesystem-specific checker. These arguments
.B must
with
.BR fsck.
.PP
-Currently, standardized file system-specific options are somewhat in
-flux. Although not guaranteed, the following options are supported
+Options to different filesystem-specific fsck's are not standardized.
+If in doubt, please consult the man pages of the filesystem-specific
+checker. Although not guaranteed, the following options are supported
by most file system checkers:
.TP
.B \-a
.B \-p
option which is safe to use, unlike the
.B \-a
-option that most file system checkers support.
+option that some file system checkers support.
+.TP
+.B \-n
+For some filesystem-specific checkers, the
+.B \-n
+option will cause the fs-specific fsck to avoid attempting to repair any
+problems, but simply report such problems to stdout. This is however
+not true for all filesystem-specific checkers. In particular,
+.BR fsck.reiserfs (8)
+will not report any corruption if given this option.
+.BR fsck.minix (8)
+does not support the
+.B \-n
+option at all.
.TP
.B \-r
Interactively repair the filesystem (ask for confirmations). Note: It
.BR e2fsck 's
default behavior; it supports this option for backwards compatibility
reasons only.
+.TP
+.B \-y
+For some filesystem-specific checkers, the
+.B \-y
+option will cause the fs-specific fsck to always attempt to fix any
+detected filesystem corruption automatically. Sometimes an expert may
+be able to do better driving the fsck manually. Note that
+.B not
+all filesystem-specific checkers implement this option. In particular
+.BR fsck.minix (8)
+and
+.BR fsck.cramfs (8)
+does not support the
+.B -y
+option as of this writing.
.SH AUTHOR
Theodore Ts'o (tytso@mit.edu)
-.PP
-The manual page was shamelessly adapted from David Engel and Fred van
-Kempen's generic
-.B fsck
-front end program, which was in turn shamelessly
-adapted from Remy Card's version for the ext2 file system.
.SH FILES
.IR /etc/fstab .
+.SH ENVIRONMENT VARIABLES
+The
+.B fsck
+program's behavior is affected by the following environment variables:
+.TP
+.B FSCK_FORCE_ALL_PARALLEL
+If this environment variable is set,
+.B fsck
+will attempt to run all of the specified filesystems in parallel,
+regardless of whether the filesystems appear to be on the same
+device. (This is useful for RAID systems or high-end storage systems
+such as those sold by companies such as IBM or EMC.)
+.TP
+.B FSCK_MAX_INST
+This environment variable will limit the maximum number of file system
+checkers that can be running at one time. This allows configurations
+which have a large number of disks to avoid
+.B fsck
+starting too many file system checkers at once, which might overload
+CPU and memory resources available on the system. If this value is
+zero, then an unlimited number of processes can be spawned. This is
+currently the default, but future versions of
+.B fsck
+may attempt to automatically determine how many file system checks can
+be run based on gathering accounting data from the operating system.
+.TP
+.B PATH
+The
+.B PATH
+environment variable is used to find file system checkers. A set of
+system directories are searched first:
+.BR /sbin ,
+.BR /sbin/fs.d ,
+.BR /sbin/fs ,
+.BR /etc/fs ,
+and
+.BR /etc .
+Then the set of directories found in the
+.B PATH
+environment are searched.
+.TP
+.B FSTAB_FILE
+This environment variable allows the system administrator
+to override the standard location of the
+.B /etc/fstab
+file. It is also useful for developers who are testing
+.BR fsck .
.SH SEE ALSO
.BR fstab (5),
.BR mkfs (8),
-.BR fsck.minix (8),
.BR fsck.ext2 (8)
or
+.BR fsck.ext3 (8)
+or
.BR e2fsck (8),
-.BR fsck.xiafs (8).
+.BR cramfsck (8),
+.BR fsck.minix (8),
+.BR fsck.msdos (8),
+.BR fsck.jfs (8),
+.BR fsck.nfs (8),
+.BR fsck.vfat (8),
+.BR fsck.xfs (8),
+.BR fsck.xiafs (8),
+.BR reiserfsck (8).