1 .\" Copyright 1993, 1994, 1995 by Theodore Ts'o. All Rights Reserved.
2 .\" This file may be copied under the terms of the GNU Public License.
4 .TH FSCK 8 "February 2009" "util-linux" "System Administration"
6 fsck \- check and repair a Linux filesystem
16 .RI [ filesystem \&...\&]
18 .RI [ fs-specific-options ]
21 is used to check and optionally repair one or more Linux filesystems.
23 can be a device name (e.g.,
24 .IR /dev/hdc1 ", " /dev/sdb2 ),
26 .IR / ", " /usr ", " /home ),
27 or an filesystem label or UUID specifier (e.g.,
28 UUID=8868abf6-88c5-4a83-98b8-bfc24057f7bd or LABEL=root).
31 program will try to handle filesystems on different physical disk drives
32 in parallel to reduce the total amount of time needed to check all of them.
34 If no filesystems are specified on the command line, and the
36 option is not specified,
38 will default to checking filesystems in
40 serially. This is equivalent to the
44 The exit status returned by
46 is the sum of the following conditions:
55 Filesystem errors corrected
58 System should be rebooted
61 Filesystem errors left uncorrected
70 Checking canceled by user request
77 The exit status returned when multiple filesystems are checked
78 is the bit-wise OR of the exit statuses for each
79 filesystem that is checked.
83 is simply a front-end for the various filesystem checkers
84 (\fBfsck\fR.\fIfstype\fR) available under Linux. The
85 filesystem-specific checker is searched for in the
86 PATH environment variable. If the PATH is undefined then
89 Please see the filesystem-specific checker manual pages for
96 lock file (/run/fsck/<diskname>.lock) for whole-disk device.
97 This option can be used with one device only (this means that \fB\-A\fR and
98 \fB\-l\fR are mutually exclusive). This option is recommended when more
100 instances are executed in the same time. The option is ignored when used for
101 multiple devices or for non-rotating disks. \fBfsck\fR does not lock underlying
102 devices when executed to check stacked devices (e.g.\& MD or DM) \(en this feature is
105 .BR \-r \ [ \fIfd\fR ]
106 Report certain statistics for each fsck when it completes. These statistics
107 include the exit status, the maximum run set size (in kilobytes), the elapsed
108 all-clock time and the user and system CPU time used by the fsck run. For
111 /dev/sda1: status 0, rss 92828, real 4.002804, user 2.677592, sys 0.86186
113 GUI front-ends may specify a file descriptor
115 in which case the progress bar information will be sent to that file descriptor
116 in a machine parsable format. For example:
118 /dev/sda1 0 92828 4.002804 2.677592 0.86186
123 operations. This is a good idea if you are checking multiple
124 filesystems and the checkers are in an interactive mode. (Note:
126 runs in an interactive mode by default. To make
128 run in a non-interactive mode, you must either specify the
132 option, if you wish for errors to be corrected automatically, or the
134 option if you do not.)
137 Specifies the type(s) of filesystem to be checked. When the
139 flag is specified, only filesystems that match
143 parameter is a comma-separated list of filesystems and options
144 specifiers. All of the filesystems in this comma-separated list may be
145 prefixed by a negation operator
149 which requests that only those filesystems not listed in
151 will be checked. If none of the filesystems in
153 is prefixed by a negation operator, then only those listed filesystems
156 Options specifiers may be included in the comma-separated
158 They must have the format
159 .BI opts= fs-option\fR.
160 If an options specifier is present, then only filesystems which contain
162 in their mount options field of
164 will be checked. If the options specifier is prefixed by a negation
166 those filesystems that do not have
168 in their mount options field of
176 then only filesystems listed in
180 option will be checked.
182 For compatibility with Mandrake distributions whose boot scripts
183 depend upon an unauthorized UI change to the
185 program, if a filesystem type of
191 were specified as an argument to the
195 Normally, the filesystem type is deduced by searching for
199 file and using the corresponding entry.
200 If the type cannot be deduced, and there is only a single filesystem
201 given as an argument to the
205 will use the specified filesystem type. If this type is not
206 available, then the default filesystem type (currently ext2) is used.
211 file and try to check all filesystems in one run. This option is
212 typically used from the
214 system initialization file, instead of multiple commands for checking
217 The root filesystem will be checked first unless the
219 option is specified (see below). After that,
220 filesystems will be checked in the order specified by the
222 (the sixth) field in the
227 value of 0 are skipped and are not checked at all. Filesystems with a
229 value of greater than zero will be checked in order,
230 with filesystems with the lowest
232 number being checked first.
233 If there are multiple filesystems with the same pass number,
235 will attempt to check them in parallel, although it will avoid running
236 multiple filesystem checks on the same physical disk.
239 does not check stacked devices (RAIDs, dm-crypt, \&...\&) in parallel with any other
240 device. See below for FSCK_FORCE_ALL_PARALLEL setting. The /sys filesystem is
241 used to determine dependencies between devices.
243 Hence, a very common configuration in
245 files is to set the root filesystem to have a
248 and to set all other filesystems to have a
250 value of 2. This will allow
252 to automatically run filesystem checkers in parallel if it is advantageous
253 to do so. System administrators might choose
254 not to use this configuration if they need to avoid multiple filesystem
255 checks running in parallel for some reason \(en for example, if the
256 machine in question is short on memory so that
257 excessive paging is a concern.
260 normally does not check whether the device actually exists before
261 calling a filesystem specific checker. Therefore non-existing
262 devices may cause the system to enter filesystem repair mode during
263 boot if the filesystem specific checker returns a fatal error. The
269 skip non-existing devices.
271 also skips non-existing devices that have the special filesystem type
274 .BR \-C \ [ \fIfd\fR ]
275 Display completion/progress bars for those filesystem checkers (currently
276 only for ext[234]) which support them. \fBfsck\fR will manage the
277 filesystem checkers so that only one of them will display
278 a progress bar at a time. GUI front-ends may specify a file descriptor
280 in which case the progress bar information will be sent to that file descriptor.
283 Do not check mounted filesystems and return an exit status of 0
284 for mounted filesystems.
287 Don't execute, just show what would be done.
292 flag is set, check the root filesystem in parallel with the other filesystems.
293 This is not the safest thing in the world to do,
294 since if the root filesystem is in doubt things like the
296 executable might be corrupted! This option is mainly provided
297 for those sysadmins who don't want to repartition the root
298 filesystem to be small and compact (which is really the right solution).
301 When checking all filesystems with the
303 flag, skip the root filesystem. (This is useful in case the root
304 filesystem has already been mounted read-write.)
307 Don't show the title on startup.
310 Produce verbose output, including all filesystem-specific commands
313 \fB\-?\fR, \fB\-\-help\fR
314 Display help text and exit.
317 Display version information and exit.
318 .SH FILESYSTEM SPECIFIC OPTIONS
319 .B Options which are not understood by fsck are passed to the filesystem-specific checker!
323 not take arguments, as there is no
326 to be able to properly guess which options take arguments and which
329 Options and arguments which follow the
331 are treated as filesystem-specific options to be passed to the
332 filesystem-specific checker.
334 Please note that \fBfsck\fR is not
335 designed to pass arbitrarily complicated options to filesystem-specific
336 checkers. If you're doing something complicated, please just
337 execute the filesystem-specific checker directly. If you pass
339 some horribly complicated options and arguments, and it doesn't do
341 .B don't bother reporting it as a bug.
342 You're almost certainly doing something that you shouldn't be doing
345 Options to different filesystem-specific fsck's are not standardized.
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 check all of the specified filesystems in parallel, regardless of
355 whether the filesystems appear to be on the same device. (This is useful for
356 RAID systems or high-end storage systems such as those sold by companies such
357 as IBM or EMC.) Note that the fs_passno value is still used.
360 This environment variable will limit the maximum number of filesystem
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 filesystem 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 filesystem checks can
370 be run based on gathering accounting data from the operating system.
375 environment variable is used to find filesystem checkers.
378 This environment variable allows the system administrator
379 to override the standard location of the
381 file. It is also useful for developers who are testing
384 .B LIBBLKID_DEBUG=all
385 enables libblkid debug output.
387 .B LIBMOUNT_DEBUG=all
388 enables libmount debug output.
393 Theodore Ts'o <tytso@mit.edu>
394 Karel Zak <kzak@redhat.com>
415 The fsck command is part of the util-linux package and is available from
416 .UR https://\:www.kernel.org\:/pub\:/linux\:/utils\:/util-linux/