2 .\" Copyright 1993, 1994, 1995 by Theodore Ts'o. All Rights Reserved.
3 .\" This file may be copied under the terms of the GNU Public License.
5 .TH FSCK 8 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
7 fsck \- check and repair a Linux file system
23 is used to check and optionally repair a one or more Linux file systems.
25 can be a device name (e.g.
26 .IR /dev/hdc1 ", " /dev/sdb2 ),
28 .IR / ", " /usr ", " /home ),
29 or an ext2 label or UUID specifier (e.g.
30 UUID=8868abf6-88c5-4a83-98b8-bfc24057f7bd or LABEL=root).
33 program will try to run filesystems on different physical disk drives
34 in parallel to reduce total amount time to check all of the filesystems.
36 The exit code returned by
38 is the sum of the following conditions:
42 \ 1\ \-\ File system errors corrected
44 \ 2\ \-\ System should be rebooted
46 \ 4\ \-\ File system errors left uncorrected
48 \ 8\ \-\ Operational error
50 \ 16\ \-\ Usage or syntax error
52 \ 32\ \-\ Fsck canceled by user request
54 \ 128\ \-\ Shared library error
56 The exit code returned when all file systems are checked using the
58 option is the bit-wise OR of the exit codes for each
59 file system that is checked.
63 is simply a front-end for the various file system checkers
64 (\fBfsck\fR.\fIfstype\fR) available under Linux. The file
65 system-specific checker is searched for in
71 and finally in the directories listed in the PATH environment
72 variable. Please see the file system-specific checker manual pages for
79 operations. This is a good idea if you checking multiple
80 filesystems and the checkers are in an interactive mode. (Note:
82 runs in an interactive mode by default. To make
84 run in a non-interactive mode, you must either specify the
88 option, if you wish for errors to be corrected automatically, or the
90 option if you do not.)
93 Specifies the type(s) of file system to be checked. When the
95 flag is specified, only filesystems that match
99 parameter is a comma-separated list of filesystems and options
100 specifiers. All of the filesystems in this comma-separated list may be
101 prefixed by a negation operator
105 which requests that only those filesystems not listed in
107 will be checked. If all of the filesystems in
109 are not prefixed by a negation operator, then only those filesystems
115 Options specifiers may be included in the comma separated
117 They must have the format
118 .BI opts= fs-option\fR,
119 and may be prefixed by a negation operator. If an options specifier is
120 present, then only filesystems whose
122 entry do (or do not, if the options specifier was prefixed by a negation
125 in their options field of the
127 file will be checked.
129 For compatibility with Mandrake distributions whose boot scripts
130 depend upon an unauthorized UI change to the
132 program, if a filesystem type of
138 were specified as an argument to the
142 Normally, the filesystem type is deduced by searching for
146 file and using the corresponding entry.
147 If the type can not be deduced, and there is only a single filesystem
148 given as an argument to the
152 will use the specified filesystem type. If this type is not
153 available, then the default file system type (currently ext2) is used.
158 file and try to check all file systems in one run. This option is
159 typically used from the
161 system initalization file, instead of multiple commands for checking
162 a single file system.
164 The root filesystem will be checked first unless the
166 option is specified (see below). After that,
167 filesystems will be checked in the order specified by the
169 (the sixth) field in the
174 value of 0 are skipped and are not checked at all. Filesystems with a
176 value of greater than zero will be checked in order,
177 with filesystems with the lowest
179 number being checked first.
180 If there are multiple filesystems with the same pass number,
181 fsck will attempt to check them in parallel, although it will avoid running
182 multiple filesystem checks on the same physical disk.
184 Hence, a very common configuration in
186 files is to set the root filesystem to have a
189 and to set all filesystems to have a
191 value of 2. This will allow
193 to automatically run filesystem checkers in parallel if it is advantageous
194 to do so. System administrators might choose
195 not to use this configuration if they need to avoid multiple filesystem
196 checks running in parallel for some reason --- for example, if the
197 machine in question is short on memory so that
198 excessive paging is a concern.
201 Display completion/progress bars for those filesystems checkers (currently
202 only for ext2) which support them. Fsck will manage the filesystem checkers
203 so that only one of them will display a progress bar at a time.
206 Don't execute, just show what would be done.
211 flag is set, check the root filesystem in parallel with the other filesystems.
212 This is not the safest thing in the world to do,
213 since if the root filesystem is in doubt things like the
215 executable might be corrupted! This option is mainly provided
216 for those sysadmins who don't want to repartition the root
217 filesystem to be small and compact (which is really the right solution).
220 When checking all file systems with the
222 flag, skip the root file system (in case it's already mounted read-write).
225 Don't show the title on startup.
228 Produce verbose output, including all file system-specific commands
232 Options which which are not understood by
234 are passed to the filesystem-specific checker. These arguments
236 not take arguments, as there is no
239 to be able to properly guess which arguments take options and which
242 Options and arguments which follow the
244 are treated as file system-specific options to be passed to the
245 file system-specific checker.
247 Please note that fsck is not
248 designed to pass arbitrarily complicated options to filesystem-specific
249 checkers. If you're doing something complicated, please just
250 execute the filesystem-specific checker directly. If you pass
252 some horribly complicated option and arguments, and it doesn't do
254 .B don't bother reporting it as a bug.
255 You're almost certainly doing something that you shouldn't be doing
259 Currently, standardized file system-specific options are somewhat in
260 flux. Although not guaranteed, the following options are supported
261 by most file system checkers:
264 Automatically repair the file system without any questions (use
265 this option with caution). Note that
269 for backwards compatibility only. This option is mapped to
272 option which is safe to use, unlike the
274 option that most file system checkers support.
277 Interactively repair the filesystem (ask for confirmations). Note: It
278 is generally a bad idea to use this option if multiple fsck's are being
279 run in parallel. Also note that this is
281 default behavior; it supports this option for backwards compatibility
284 Theodore Ts'o (tytso@mit.edu)
287 .SH ENVIRONMENT VARIABLES
290 program's behavior is affected by the following environment variables:
292 .B FSCK_FORCE_ALL_PARALLEL
293 If this environment variable is set,
295 will attempt to run all of the specified filesystems in parallel,
296 regardless of whether the filesystems appear to be on the same
297 device. (This is useful for RAID systems or high-end storage systems
298 such as those sold by companies such as IBM or EMC.)
301 This environment variable will limit the maximum number of file system
302 checkers that can be running at one time. This allows configurations
303 which have a large number of disks to avoid
305 starting too many file system checkers at once, which might overload
306 CPU and memory resources available on the system. If this value is
307 zero, then an unlimited number of processes can be spawned. This is
308 currently the default, but future versions of
310 may attempt to automatically determine how many file system checks can
311 be run based on gathering accounting data from the operating system.
316 environment variable is used to find file system checkers. A set of
317 system directories are searched first:
324 Then the set of directories found in the
326 environment are searched.
329 This environment variable allows the system administrator
330 to override the standard location of the
332 file. It is also use for developers who are testing