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
19 .B fs-specific-options
23 is used to check and optionally repair 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 If no filesystems are specified on the command line, and the
38 option is not specified,
40 will default to checking filesystems in
42 serial. This is equivalent to the
46 The exit code returned by
48 is the sum of the following conditions:
52 \ 1\ \-\ File system errors corrected
54 \ 2\ \-\ System should be rebooted
56 \ 4\ \-\ File system errors left uncorrected
58 \ 8\ \-\ Operational error
60 \ 16\ \-\ Usage or syntax error
62 \ 32\ \-\ Fsck canceled by user request
64 \ 128\ \-\ Shared library error
66 The exit code returned when multiple file systems are checked
67 is the bit-wise OR of the exit codes for each
68 file system that is checked.
72 is simply a front-end for the various file system checkers
73 (\fBfsck\fR.\fIfstype\fR) available under Linux. The file
74 system-specific checker is searched for in
80 and finally in the directories listed in the PATH environment
81 variable. Please see the file system-specific checker manual pages for
88 operations. This is a good idea if you are checking multiple
89 filesystems and the checkers are in an interactive mode. (Note:
91 runs in an interactive mode by default. To make
93 run in a non-interactive mode, you must either specify the
97 option, if you wish for errors to be corrected automatically, or the
99 option if you do not.)
102 Specifies the type(s) of file system to be checked. When the
104 flag is specified, only filesystems that match
108 parameter is a comma-separated list of filesystems and options
109 specifiers. All of the filesystems in this comma-separated list may be
110 prefixed by a negation operator
114 which requests that only those filesystems not listed in
116 will be checked. If all of the filesystems in
118 are not prefixed by a negation operator, then only those filesystems
124 Options specifiers may be included in the comma separated
126 They must have the format
127 .BI opts= fs-option\fR.
128 If an options specifier is present, then only filesystems which contain
130 in their mount options field of
132 will be checked. If the options specifier is prefixed by a negation
134 those filesystems that do not have
136 in their mount options field of
144 then only filesystems listed in
148 option will be checked.
150 For compatibility with Mandrake distributions whose boot scripts
151 depend upon an unauthorized UI change to the
153 program, if a filesystem type of
159 were specified as an argument to the
163 Normally, the filesystem type is deduced by searching for
167 file and using the corresponding entry.
168 If the type can not be deduced, and there is only a single filesystem
169 given as an argument to the
173 will use the specified filesystem type. If this type is not
174 available, then the default file system type (currently ext2) is used.
179 file and try to check all file systems in one run. This option is
180 typically used from the
182 system initalization file, instead of multiple commands for checking
183 a single file system.
185 The root filesystem will be checked first unless the
187 option is specified (see below). After that,
188 filesystems will be checked in the order specified by the
190 (the sixth) field in the
195 value of 0 are skipped and are not checked at all. Filesystems with a
197 value of greater than zero will be checked in order,
198 with filesystems with the lowest
200 number being checked first.
201 If there are multiple filesystems with the same pass number,
202 fsck will attempt to check them in parallel, although it will avoid running
203 multiple filesystem checks on the same physical disk.
205 Hence, a very common configuration in
207 files is to set the root filesystem to have a
210 and to set all filesystems to have a
212 value of 2. This will allow
214 to automatically run filesystem checkers in parallel if it is advantageous
215 to do so. System administrators might choose
216 not to use this configuration if they need to avoid multiple filesystem
217 checks running in parallel for some reason --- for example, if the
218 machine in question is short on memory so that
219 excessive paging is a concern.
222 Display completion/progress bars for those filesystems checkers (currently
223 only for ext2) which support them. Fsck will manage the filesystem checkers
224 so that only one of them will display a progress bar at a time.
227 Don't execute, just show what would be done.
232 flag is set, check the root filesystem in parallel with the other filesystems.
233 This is not the safest thing in the world to do,
234 since if the root filesystem is in doubt things like the
236 executable might be corrupted! This option is mainly provided
237 for those sysadmins who don't want to repartition the root
238 filesystem to be small and compact (which is really the right solution).
241 When checking all file systems with the
243 flag, skip the root file system (in case it's already mounted read-write).
246 Don't show the title on startup.
249 Produce verbose output, including all file system-specific commands
252 .B fs-specific-options
253 Options which are not understood by
255 are passed to the filesystem-specific checker. These arguments
257 not take arguments, as there is no
260 to be able to properly guess which arguments take options and which
263 Options and arguments which follow the
265 are treated as file system-specific options to be passed to the
266 file system-specific checker.
268 Please note that fsck is not
269 designed to pass arbitrarily complicated options to filesystem-specific
270 checkers. If you're doing something complicated, please just
271 execute the filesystem-specific checker directly. If you pass
273 some horribly complicated option and arguments, and it doesn't do
275 .B don't bother reporting it as a bug.
276 You're almost certainly doing something that you shouldn't be doing
280 Currently, standardized file system-specific options are somewhat in
281 flux. Although not guaranteed, the following options are supported
282 by most file system checkers:
285 Automatically repair the file system without any questions (use
286 this option with caution). Note that
290 for backwards compatibility only. This option is mapped to
293 option which is safe to use, unlike the
295 option that most file system checkers support.
298 Interactively repair the filesystem (ask for confirmations). Note: It
299 is generally a bad idea to use this option if multiple fsck's are being
300 run in parallel. Also note that this is
302 default behavior; it supports this option for backwards compatibility
305 Theodore Ts'o (tytso@mit.edu)
308 .SH ENVIRONMENT VARIABLES
311 program's behavior is affected by the following environment variables:
313 .B FSCK_FORCE_ALL_PARALLEL
314 If this environment variable is set,
316 will attempt to run all of the specified filesystems in parallel,
317 regardless of whether the filesystems appear to be on the same
318 device. (This is useful for RAID systems or high-end storage systems
319 such as those sold by companies such as IBM or EMC.)
322 This environment variable will limit the maximum number of file system
323 checkers that can be running at one time. This allows configurations
324 which have a large number of disks to avoid
326 starting too many file system checkers at once, which might overload
327 CPU and memory resources available on the system. If this value is
328 zero, then an unlimited number of processes can be spawned. This is
329 currently the default, but future versions of
331 may attempt to automatically determine how many file system checks can
332 be run based on gathering accounting data from the operating system.
337 environment variable is used to find file system checkers. A set of
338 system directories are searched first:
345 Then the set of directories found in the
347 environment are searched.
350 This environment variable allows the system administrator
351 to override the standard location of the
353 file. It is also use for developers who are testing