Whamcloud - gitweb
Suppress annoying missing field initializer warnings
[tools/e2fsprogs.git] / misc / fsck.8.in
index 7e53932..50fd8ce 100644 (file)
@@ -8,18 +8,25 @@ fsck \- check and repair a Linux file system
 .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 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 ),
@@ -27,10 +34,21 @@ a mount point (e.g.
 .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
@@ -48,11 +66,12 @@ is the sum of the following conditions:
 .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,
@@ -73,7 +92,7 @@ further details.
 .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 
@@ -109,19 +128,31 @@ in
 .I fslist
 will be checked.
 .sp
-Options specifiers may be included in the comma separated
+Options specifiers may be included in the comma-separated
 .IR fslist .
 They must have the format 
-.BI opts= fs-option\fR,
-and may be prefixed by a negation operator.  If an options specifier is
-present, then only filesystems whose 
+.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
-entry do (or do not, if the options specifier was prefixed by a negation
-operator) contain 
+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 options field of the
+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 
-file will be checked.
+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
@@ -155,7 +186,7 @@ Walk through the
 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
@@ -168,16 +199,22 @@ filesystems will be checked in the order specified by 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, 
 fsck will attempt to check them in parallel, although it will avoid running 
 multiple filesystem checks on the same physical disk.  
+.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
@@ -188,10 +225,17 @@ 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.
@@ -219,8 +263,8 @@ Don't show the title on startup.
 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
@@ -247,8 +291,9 @@ You're almost certainly doing something that you shouldn't be doing
 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
@@ -262,7 +307,20 @@ for backwards compatibility only.  This option is mapped to
 .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
@@ -271,21 +329,86 @@ run in parallel.  Also note that this is
 .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).