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 run filesystems on different physical disk drives
40 in parallel to reduce total amount time to check all of the filesystems.
42 If no filesystems are specified on the command line, and the
44 option is not specified,
46 will default to checking filesystems in
48 serial. This is equivalent to the
52 The exit code returned by
54 is the sum of the following conditions:
58 \ 1\ \-\ File system errors corrected
60 \ 2\ \-\ System should be rebooted
62 \ 4\ \-\ File system errors left uncorrected
64 \ 8\ \-\ Operational error
66 \ 16\ \-\ Usage or syntax error
68 \ 32\ \-\ Fsck canceled by user request
70 \ 128\ \-\ Shared library error
72 The exit code returned when multiple file systems are checked
73 is the bit-wise OR of the exit codes for each
74 file system that is checked.
78 is simply a front-end for the various file system checkers
79 (\fBfsck\fR.\fIfstype\fR) available under Linux. The file
80 system-specific checker is searched for in
86 and finally in the directories listed in the PATH environment
87 variable. Please see the file system-specific checker manual pages for
94 operations. This is a good idea if you are checking multiple
95 filesystems and the checkers are in an interactive mode. (Note:
97 runs in an interactive mode by default. To make
99 run in a non-interactive mode, you must either specify the
103 option, if you wish for errors to be corrected automatically, or the
105 option if you do not.)
108 Specifies the type(s) of file system to be checked. When the
110 flag is specified, only filesystems that match
114 parameter is a comma-separated list of filesystems and options
115 specifiers. All of the filesystems in this comma-separated list may be
116 prefixed by a negation operator
120 which requests that only those filesystems not listed in
122 will be checked. If all of the filesystems in
124 are not prefixed by a negation operator, then only those filesystems
130 Options specifiers may be included in the comma separated
132 They must have the format
133 .BI opts= fs-option\fR.
134 If an options specifier is present, then only filesystems which contain
136 in their mount options field of
138 will be checked. If the options specifier is prefixed by a negation
140 those filesystems that do not have
142 in their mount options field of
150 then only filesystems listed in
154 option will be checked.
156 For compatibility with Mandrake distributions whose boot scripts
157 depend upon an unauthorized UI change to the
159 program, if a filesystem type of
165 were specified as an argument to the
169 Normally, the filesystem type is deduced by searching for
173 file and using the corresponding entry.
174 If the type can not be deduced, and there is only a single filesystem
175 given as an argument to the
179 will use the specified filesystem type. If this type is not
180 available, then the default file system type (currently ext2) is used.
185 file and try to check all file systems in one run. This option is
186 typically used from the
188 system initalization file, instead of multiple commands for checking
189 a single file system.
191 The root filesystem will be checked first unless the
193 option is specified (see below). After that,
194 filesystems will be checked in the order specified by the
196 (the sixth) field in the
201 value of 0 are skipped and are not checked at all. Filesystems with a
203 value of greater than zero will be checked in order,
204 with filesystems with the lowest
206 number being checked first.
207 If there are multiple filesystems with the same pass number,
208 fsck will attempt to check them in parallel, although it will avoid running
209 multiple filesystem checks on the same physical disk.
211 Hence, a very common configuration in
213 files is to set the root filesystem to have a
216 and to set all filesystems to have a
218 value of 2. This will allow
220 to automatically run filesystem checkers in parallel if it is advantageous
221 to do so. System administrators might choose
222 not to use this configuration if they need to avoid multiple filesystem
223 checks running in parallel for some reason --- for example, if the
224 machine in question is short on memory so that
225 excessive paging is a concern.
227 .B \-C\fR [ \fI "fd" \fR ]
228 Display completion/progress bars for those filesystem checkers (currently
229 only for ext2 and ext3) which support them. Fsck will manage the
230 filesystem checkers so that only one of them will display
231 a progress bar at a time. GUI front-ends may specify a file descriptor
233 in which case the progress bar information will be sent that file descriptor.
236 Don't execute, just show what would be done.
241 flag is set, check the root filesystem in parallel with the other filesystems.
242 This is not the safest thing in the world to do,
243 since if the root filesystem is in doubt things like the
245 executable might be corrupted! This option is mainly provided
246 for those sysadmins who don't want to repartition the root
247 filesystem to be small and compact (which is really the right solution).
250 When checking all file systems with the
252 flag, skip the root file system (in case it's already mounted read-write).
255 Don't show the title on startup.
258 Produce verbose output, including all file system-specific commands
261 .B fs-specific-options
262 Options which are not understood by
264 are passed to the filesystem-specific checker. These arguments
266 not take arguments, as there is no
269 to be able to properly guess which arguments take options and which
272 Options and arguments which follow the
274 are treated as file system-specific options to be passed to the
275 file system-specific checker.
277 Please note that fsck is not
278 designed to pass arbitrarily complicated options to filesystem-specific
279 checkers. If you're doing something complicated, please just
280 execute the filesystem-specific checker directly. If you pass
282 some horribly complicated option and arguments, and it doesn't do
284 .B don't bother reporting it as a bug.
285 You're almost certainly doing something that you shouldn't be doing
289 Options to different filesystem-specific fsck's are not standardized.
290 If in doubt, please consult the man pages of the filesystem-specific
291 checker. Although not guaranteed, the following options are supported
292 by most file system checkers:
295 Automatically repair the file system without any questions (use
296 this option with caution). Note that
300 for backwards compatibility only. This option is mapped to
303 option which is safe to use, unlike the
305 option that some file system checkers support.
308 For some filesystem-specific checkers, the
310 option will cause the fs-specific fsck to avoid attempting to repair any
311 problems, but simply report such problems to stdout. This is however
312 not true for all filesystem-specific checkers. In particular,
313 .BR fsck.reiserfs (8)
314 will not report any corruption if given this option.
321 Interactively repair the filesystem (ask for confirmations). Note: It
322 is generally a bad idea to use this option if multiple fsck's are being
323 run in parallel. Also note that this is
325 default behavior; it supports this option for backwards compatibility
329 For some filesystem-specific checkers, the
331 option will cause the fs-specific fsck to always attempt to fix any
332 detected filesystem corruption automatically. Sometimes an expert may
333 be able to do better driving the fsck manually. Note that
335 all filesystem-specific checkers implement this option. In particular
341 option as of this writing.
343 Theodore Ts'o (tytso@mit.edu)
346 .SH ENVIRONMENT VARIABLES
349 program's behavior is affected by the following environment variables:
351 .B FSCK_FORCE_ALL_PARALLEL
352 If this environment variable is set,
354 will attempt to run all of the specified filesystems in parallel,
355 regardless of whether the filesystems appear to be on the same
356 device. (This is useful for RAID systems or high-end storage systems
357 such as those sold by companies such as IBM or EMC.)
360 This environment variable will limit the maximum number of file system
361 checkers that can be running at one time. This allows configurations
362 which have a large number of disks to avoid
364 starting too many file system checkers at once, which might overload
365 CPU and memory resources available on the system. If this value is
366 zero, then an unlimited number of processes can be spawned. This is
367 currently the default, but future versions of
369 may attempt to automatically determine how many file system checks can
370 be run based on gathering accounting data from the operating system.
375 environment variable is used to find file system checkers. A set of
376 system directories are searched first:
383 Then the set of directories found in the
385 environment are searched.
388 This environment variable allows the system administrator
389 to override the standard location of the
391 file. It is also use for developers who are testing