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 \ 128\ \-\ Shared library error
54 The exit code returned when all file systems are checked using the
56 option is the bit-wise OR of the exit codes for each
57 file system that is checked.
61 is simply a front-end for the various file system checkers
62 (\fBfsck\fR.\fIfstype\fR) available under Linux. The file
63 system-specific checker is searched for in
69 and finally in the directories listed in the PATH environment
70 variable. Please see the file system-specific checker manual pages for
77 operations. This is a good idea if you checking multiple
78 filesystems and the checkers are in an interactive mode. (Note:
80 runs in an interactive mode by default. To make
82 run in a non-interactive mode, you must either specify the
86 option, if you wish for errors to be corrected automatically, or the
88 option if you do not.)
91 Specifies the type(s) of file system to be checked. When the
93 flag is specified, only filesystems that match
97 parameter is a comma-separated list of filesystems and options
98 specifiers. All of the filesystems in this comma-separated list may be
99 prefixed by a negation operator
103 which requests that only those filesystems not listed in
105 will be checked. If all of the filesystems in
107 are not prefixed by a negation operator, then only those filesystems
113 Options specifiers may be included in the comma separated
115 They must have the format
116 .BI opts= fs-option\fR,
117 and may be prefixed by a negation operator. If an options specifier is
118 present, then only filesystems whose
120 entry do (or do not, if the options specifier was prefixed by a negation
123 in their options field of the
125 file will be checked.
127 For compatibility with Mandrake distributions whose boot scripts
128 depend upon an unauthorized UI change to the
130 program, if a filesystem type of
136 were specified as an argument to the
140 Normally, the filesystem type is deduced by searching for
144 file and using the corresponding entry.
145 If the type can not be deduced, and there is only a single filesystem
146 given as an argument to the
150 will use the specified filesystem type. If this type is not
151 available, then the default file system type (currently ext2) is used.
156 file and try to check all file systems in one run. This option is
157 typically used from the
159 system initalization file, instead of multiple commands for checking
160 a single file system.
162 The root filesystem will be checked first unless the
164 option is specified (see below). After that,
165 filesystems will be checked in the order specified by the
167 (the sixth) field in the
172 value of 0 are skipped and are not checked at all. Filesystems with a
174 value of greater than zero will be checked in order,
175 with filesystems with the lowest
177 number being checked first.
178 If there are multiple filesystems with the same pass number,
179 fsck will attempt to check them in parallel, although it will avoid running
180 multiple filesystem checks on the same physical disk.
182 Hence, a very common configuration in
184 files is to set the root filesystem to have a
187 and to set all filesystems to have a
189 value of 2. This will allow
191 to automatically run filesystem checkers in parallel if it is advantageous
192 to do so. System administrators might choose
193 not to use this configuration if they need to avoid multiple filesystem
194 checks running in parallel for some reason --- for example, if the
195 machine in question is short on memory so that
196 excessive paging is a concern.
199 Display completion/progress bars for those filesystems checkers (currently
200 only for ext2) which support them. Fsck will manage the filesystem checkers
201 so that only one of them will display a progress bar at a time.
204 Don't execute, just show what would be done.
209 flag is set, check the root filesystem in parallel with the other filesystems.
210 This is not the safest thing in the world to do,
211 since if the root filesystem is in doubt things like the
213 executable might be corrupted! This option is mainly provided
214 for those sysadmins who don't want to repartition the root
215 filesystem to be small and compact (which is really the right solution).
218 When checking all file systems with the
220 flag, skip the root file system (in case it's already mounted read-write).
223 Don't show the title on startup.
226 Produce verbose output, including all file system-specific commands
230 Options which which are not understood by
232 are passed to the filesystem-specific checker. These arguments
234 not take arguments, as there is no
237 to be able to properly guess which arguments take options and which
240 Options and arguments which follow the
242 are treated as file system-specific options to be passed to the
243 file system-specific checker.
245 Please note that fsck is not
246 designed to pass arbitrarily complicated options to filesystem-specific
247 checkers. If you're doing something complicated, please just
248 execute the filesystem-specific checker directly. If you pass
250 some horribly complicated option and arguments, and it doesn't do
252 .B don't bother reporting it as a bug.
253 You're almost certainly doing something that you shouldn't be doing
257 Currently, standardized file system-specific options are somewhat in
258 flux. Although not guaranteed, the following options are supported
259 by most file system checkers:
262 Automatically repair the file system without any questions (use
263 this option with caution). Note that
267 for backwards compatibility only. This option is mapped to
270 option which is safe to use, unlike the
272 option that most file system checkers support.
275 Interactively repair the filesystem (ask for confirmations). Note: It
276 is generally a bad idea to use this option if multiple fsck's are being
277 run in parallel. Also note that this is
279 default behavior; it supports this option for backwards compatibility
282 Theodore Ts'o (tytso@mit.edu)
285 .SH ENVIRONMENT VARIABLES
288 program's behavior is affected by the following environment variables:
290 .B FSCK_FORCE_ALL_PARALLEL
291 If this environment variable is set,
293 will attempt to run all of the specified filesystems in parallel,
294 regardless of whether the filesystems appear to be on the same
295 device. (This is useful for RAID systems or high-end storage systems
296 such as those sold by companies such as IBM or EMC.)
299 This environment variable will limit the maximum number of file system
300 checkers that can be running at one time. This allows configurations
301 which have a large number of disks to avoid
303 starting too many file system checkers at once, which might overload
304 CPU and memory resources available on the system. If this value is
305 zero, then an unlimited number of processes can be spawned. This is
306 currently the default, but future versions of
308 may attempt to automatically determine how many file system checks can
309 be run based on gathering accounting data from the operating system.
314 environment variable is used to find file system checkers. A set of
315 system directories are searched first:
322 Then the set of directories found in the
324 environment are searched.
327 This environment variable allows the system administrator
328 to override the standard location of the
330 file. It is also use for developers who are testing