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
25 .B fs-specific-options
29 is used to check and optionally repair one or more Linux file systems.
31 can be a device name (e.g.
32 .IR /dev/hdc1 ", " /dev/sdb2 ),
34 .IR / ", " /usr ", " /home ),
35 or an ext2 label or UUID specifier (e.g.
36 UUID=8868abf6-88c5-4a83-98b8-bfc24057f7bd or LABEL=root).
39 program will try to handle file systems on different physical disk drives
40 in parallel to reduce the total amount of time needed to check all of the
43 If no file systems are specified on the command line, and the
45 option is not specified,
47 will default to checking file systems in
49 serially. This is equivalent to the
53 The exit code returned by
55 is the sum of the following conditions:
59 \ 1\ \-\ File system errors corrected
61 \ 2\ \-\ System should be rebooted
63 \ 4\ \-\ File system errors left uncorrected
65 \ 8\ \-\ Operational error
67 \ 16\ \-\ Usage or syntax error
69 \ 32\ \-\ Fsck canceled by user request
71 \ 128\ \-\ Shared library error
73 The exit code returned when multiple file systems are checked
74 is the bit-wise OR of the exit codes for each
75 file system that is checked.
79 is simply a front-end for the various file system checkers
80 (\fBfsck\fR.\fIfstype\fR) available under Linux. The file
81 system-specific checker is searched for in
87 and finally in the directories listed in the PATH environment
88 variable. Please see the file system-specific checker manual pages for
95 operations. This is a good idea if you are checking multiple
96 file systems and the checkers are in an interactive mode. (Note:
98 runs in an interactive mode by default. To make
100 run in a non-interactive mode, you must either specify the
104 option, if you wish for errors to be corrected automatically, or the
106 option if you do not.)
109 Specifies the type(s) of file system to be checked. When the
111 flag is specified, only file systems that match
115 parameter is a comma-separated list of file systems and options
116 specifiers. All of the file systems in this comma-separated list may be
117 prefixed by a negation operator
121 which requests that only those file systems not listed in
123 will be checked. If all of the file systems in
125 are not prefixed by a negation operator, then only those file systems
131 Options specifiers may be included in the comma-separated
133 They must have the format
134 .BI opts= fs-option\fR.
135 If an options specifier is present, then only file systems which contain
137 in their mount options field of
139 will be checked. If the options specifier is prefixed by a negation
141 those file systems that do not have
143 in their mount options field of
151 then only file systems listed in
155 option will be checked.
157 For compatibility with Mandrake distributions whose boot scripts
158 depend upon an unauthorized UI change to the
160 program, if a file system type of
166 were specified as an argument to the
170 Normally, the file system type is deduced by searching for
174 file and using the corresponding entry.
175 If the type can not be deduced, and there is only a single file system
176 given as an argument to the
180 will use the specified file system type. If this type is not
181 available, then the default file system type (currently ext2) is used.
186 file and try to check all file systems in one run. This option is
187 typically used from the
189 system initialization file, instead of multiple commands for checking
190 a single file system.
192 The root file system will be checked first unless the
194 option is specified (see below). After that,
195 file systems will be checked in the order specified by the
197 (the sixth) field in the
202 value of 0 are skipped and are not checked at all. File Systems with a
204 value of greater than zero will be checked in order,
205 with file systems with the lowest
207 number being checked first.
208 If there are multiple file systems with the same pass number,
209 fsck will attempt to check them in parallel, although it will avoid running
210 multiple file system checks on the same physical disk.
212 Hence, a very common configuration in
214 files is to set the root file system to have a
217 and to set all other file systems to have a
219 value of 2. This will allow
221 to automatically run file system checkers in parallel if it is advantageous
222 to do so. System administrators might choose
223 not to use this configuration if they need to avoid multiple file system
224 checks running in parallel for some reason --- for example, if the
225 machine in question is short on memory so that
226 excessive paging is a concern.
228 .B \-C\fR [ \fI "fd" \fR ]
229 Display completion/progress bars for those file system checkers (currently
230 only for ext2 and ext3) which support them. Fsck will manage the
231 file system checkers so that only one of them will display
232 a progress bar at a time. GUI front-ends may specify a file descriptor
234 in which case the progress bar information will be sent to that file descriptor.
237 Do not check mounted file systems and return an exit code of 0
238 for mounted file systems.
241 Don't execute, just show what would be done.
246 flag is set, check the root file system in parallel with the other file systems.
247 This is not the safest thing in the world to do,
248 since if the root file system is in doubt things like the
250 executable might be corrupted! This option is mainly provided
251 for those sysadmins who don't want to repartition the root
252 file system to be small and compact (which is really the right solution).
255 When checking all file systems with the
257 flag, skip the root file system (in case it's already mounted read-write).
260 Don't show the title on startup.
263 Produce verbose output, including all file system-specific commands
266 .B fs-specific-options
267 Options which are not understood by
269 are passed to the file system-specific checker. These arguments
271 not take arguments, as there is no
274 to be able to properly guess which arguments take options and which
277 Options and arguments which follow the
279 are treated as file system-specific options to be passed to the
280 file system-specific checker.
282 Please note that fsck is not
283 designed to pass arbitrarily complicated options to file system-specific
284 checkers. If you're doing something complicated, please just
285 execute the file system-specific checker directly. If you pass
287 some horribly complicated option and arguments, and it doesn't do
289 .B don't bother reporting it as a bug.
290 You're almost certainly doing something that you shouldn't be doing
294 Options to different file system-specific fsck's are not standardized.
295 If in doubt, please consult the man pages of the file system-specific
296 checker. Although not guaranteed, the following options are supported
297 by most file system checkers:
300 Automatically repair the file system without any questions (use
301 this option with caution). Note that
305 for backwards compatibility only. This option is mapped to
308 option which is safe to use, unlike the
310 option that some file system checkers support.
313 For some file system-specific checkers, the
315 option will cause the fs-specific fsck to avoid attempting to repair any
316 problems, but simply report such problems to stdout. This is however
317 not true for all file system-specific checkers. In particular,
318 .BR fsck.reiserfs (8)
319 will not report any corruption if given this option.
326 Interactively repair the file system (ask for confirmations). Note: It
327 is generally a bad idea to use this option if multiple fsck's are being
328 run in parallel. Also note that this is
330 default behavior; it supports this option for backwards compatibility
334 For some file system-specific checkers, the
336 option will cause the fs-specific fsck to always attempt to fix any
337 detected file system corruption automatically. Sometimes an expert may
338 be able to do better driving the fsck manually. Note that
340 all file system-specific checkers implement this option. In particular
346 option as of this writing.
348 Theodore Ts'o (tytso@mit.edu)
351 .SH ENVIRONMENT VARIABLES
354 program's behavior is affected by the following environment variables:
356 .B FSCK_FORCE_ALL_PARALLEL
357 If this environment variable is set,
359 will attempt to run all of the specified file systems in parallel,
360 regardless of whether the file systems appear to be on the same
361 device. (This is useful for RAID systems or high-end storage systems
362 such as those sold by companies such as IBM or EMC.)
365 This environment variable will limit the maximum number of file system
366 checkers that can be running at one time. This allows configurations
367 which have a large number of disks to avoid
369 starting too many file system checkers at once, which might overload
370 CPU and memory resources available on the system. If this value is
371 zero, then an unlimited number of processes can be spawned. This is
372 currently the default, but future versions of
374 may attempt to automatically determine how many file system checks can
375 be run based on gathering accounting data from the operating system.
380 environment variable is used to find file system checkers. A set of
381 system directories are searched first:
388 Then the set of directories found in the
390 environment are searched.
393 This environment variable allows the system administrator
394 to override the standard location of the
396 file. It is also useful for developers who are testing