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 "February 2009" "util-linux" "System Administration"
7 fsck \- check and repair a Linux filesystem
17 .RI [ fs-specific-options ]
20 is used to check and optionally repair one or more Linux filesystems.
22 can be a device name (e.g.
23 .IR /dev/hdc1 ", " /dev/sdb2 ),
25 .IR / ", " /usr ", " /home ),
26 or an ext2 label or UUID specifier (e.g.
27 UUID=8868abf6-88c5-4a83-98b8-bfc24057f7bd or LABEL=root).
30 program will try to handle filesystems on different physical disk drives
31 in parallel to reduce the total amount of time needed to check all of them.
33 If no filesystems are specified on the command line, and the
35 option is not specified,
37 will default to checking filesystems in
39 serially. This is equivalent to the
43 The exit code returned by
45 is the sum of the following conditions:
54 Filesystem errors corrected
57 System should be rebooted
60 Filesystem errors left uncorrected
69 Fsck canceled by user request
76 The exit code returned when multiple filesystems are checked
77 is the bit-wise OR of the exit codes for each
78 filesystem that is checked.
82 is simply a front-end for the various filesystem checkers
83 (\fBfsck\fR.\fIfstype\fR) available under Linux. The
84 filesystem-specific checker is searched for in
90 and finally in the directories listed in the PATH environment
91 variable. Please see the filesystem-specific checker manual pages for
96 Lock the whole-disk device by an exclusive
98 This option can be used with one device only (this means that \fB-A\fR and
99 \fB-l\fR are mutually exclusive). This option is recommended when more
101 instances are executed in the same time. The option is ignored when used for
102 multiple devices or for non-rotating disks. \fBfsck\fR does not lock underlying
103 devices when executed to check stacked devices (e.g. MD or DM) -- this feature is
107 Report certain statistics for each fsck when it completes. These statistics
108 include the exit status, the maximum run set size (in kilobytes), the elapsed
109 all-clock time and the user and system CPU time used by the fsck run. For
112 /dev/sda1: status 0, rss 92828, real 4.002804, user 2.677592, sys 0.86186
117 operations. This is a good idea if you are checking multiple
118 filesystems and the checkers are in an interactive mode. (Note:
120 runs in an interactive mode by default. To make
122 run in a non-interactive mode, you must either specify the
126 option, if you wish for errors to be corrected automatically, or the
128 option if you do not.)
131 Specifies the type(s) of filesystem to be checked. When the
133 flag is specified, only filesystems that match
137 parameter is a comma-separated list of filesystems and options
138 specifiers. All of the filesystems in this comma-separated list may be
139 prefixed by a negation operator
143 which requests that only those filesystems not listed in
145 will be checked. If none of the filesystems in
147 is prefixed by a negation operator, then only those listed filesystems
150 Options specifiers may be included in the comma-separated
152 They must have the format
153 .BI opts= fs-option\fR.
154 If an options specifier is present, then only filesystems which contain
156 in their mount options field of
158 will be checked. If the options specifier is prefixed by a negation
160 those filesystems that do not have
162 in their mount options field of
170 then only filesystems listed in
174 option will be checked.
176 For compatibility with Mandrake distributions whose boot scripts
177 depend upon an unauthorized UI change to the
179 program, if a filesystem type of
185 were specified as an argument to the
189 Normally, the filesystem type is deduced by searching for
193 file and using the corresponding entry.
194 If the type can not be deduced, and there is only a single filesystem
195 given as an argument to the
199 will use the specified filesystem type. If this type is not
200 available, then the default filesystem type (currently ext2) is used.
205 file and try to check all filesystems in one run. This option is
206 typically used from the
208 system initialization file, instead of multiple commands for checking
211 The root filesystem will be checked first unless the
213 option is specified (see below). After that,
214 filesystems will be checked in the order specified by the
216 (the sixth) field in the
221 value of 0 are skipped and are not checked at all. Filesystems with a
223 value of greater than zero will be checked in order,
224 with filesystems with the lowest
226 number being checked first.
227 If there are multiple filesystems with the same pass number,
228 fsck will attempt to check them in parallel, although it will avoid running
229 multiple filesystem checks on the same physical disk.
232 does not check stacked devices (RAIDs, dm-crypt, ...) in parallel with any other
233 device. See below for FSCK_FORCE_ALL_PARALLEL setting. The /sys filesystem is
234 used to detemine dependencies between devices.
236 Hence, a very common configuration in
238 files is to set the root filesystem to have a
241 and to set all other filesystems to have a
243 value of 2. This will allow
245 to automatically run filesystem checkers in parallel if it is advantageous
246 to do so. System administrators might choose
247 not to use this configuration if they need to avoid multiple filesystem
248 checks running in parallel for some reason --- for example, if the
249 machine in question is short on memory so that
250 excessive paging is a concern.
253 normally does not check whether the device actually exists before
254 calling a filesystem specific checker. Therefore non-existing
255 devices may cause the system to enter filesystem repair mode during
256 boot if the filesystem specific checker returns a fatal error. The
262 skip non-existing devices.
264 also skips non-existing devices that have the special filesystem type
267 .B \-C\fR [ \fI "fd" \fR ]
268 Display completion/progress bars for those filesystem checkers (currently
269 only for ext2 and ext3) which support them. Fsck will manage the
270 filesystem checkers so that only one of them will display
271 a progress bar at a time. GUI front-ends may specify a file descriptor
273 in which case the progress bar information will be sent to that file descriptor.
276 Do not check mounted filesystems and return an exit code of 0
277 for mounted filesystems.
280 Don't execute, just show what would be done.
285 flag is set, check the root filesystem in parallel with the other filesystems.
286 This is not the safest thing in the world to do,
287 since if the root filesystem is in doubt things like the
289 executable might be corrupted! This option is mainly provided
290 for those sysadmins who don't want to repartition the root
291 filesystem to be small and compact (which is really the right solution).
294 When checking all filesystems with the
296 flag, skip the root filesystem. (This is useful in case the root
297 filesystem has already been mounted read-write.)
300 Don't show the title on startup.
303 Produce verbose output, including all filesystem-specific commands
306 .B fs-specific-options
307 Options which are not understood by
309 are passed to the filesystem-specific checker. These arguments
311 not take arguments, as there is no
314 to be able to properly guess which options take arguments and which
317 Options and arguments which follow the
319 are treated as filesystem-specific options to be passed to the
320 filesystem-specific checker.
322 Please note that fsck is not
323 designed to pass arbitrarily complicated options to filesystem-specific
324 checkers. If you're doing something complicated, please just
325 execute the filesystem-specific checker directly. If you pass
327 some horribly complicated options and arguments, and it doesn't do
329 .B don't bother reporting it as a bug.
330 You're almost certainly doing something that you shouldn't be doing
334 Options to different filesystem-specific fsck's are not standardized.
335 If in doubt, please consult the man pages of the filesystem-specific
336 checker. Although not guaranteed, the following options are supported
337 by most filesystem checkers:
340 Automatically repair the filesystem without any questions (use
341 this option with caution). Note that
345 for backward compatibility only. This option is mapped to
348 option which is safe to use, unlike the
350 option that some filesystem checkers support.
353 For some filesystem-specific checkers, the
355 option will cause the fs-specific fsck to avoid attempting to repair any
356 problems, but simply report such problems to stdout. This is however
357 not true for all filesystem-specific checkers. In particular,
358 .BR fsck.reiserfs (8)
359 will not report any corruption if given this option.
366 Interactively repair the filesystem (ask for confirmations). Note: It
367 is generally a bad idea to use this option if multiple fsck's are being
368 run in parallel. Also note that this is
370 default behavior; it supports this option for backward compatibility
374 For some filesystem-specific checkers, the
376 option will cause the fs-specific fsck to always attempt to fix any
377 detected filesystem corruption automatically. Sometimes an expert may
378 be able to do better driving the fsck manually. Note that
380 all filesystem-specific checkers implement this option. In particular
386 option as of this writing.
392 The fsck command is part of the util-linux package and is available from
393 .UR ftp://\:ftp.kernel.org\:/pub\:/linux\:/utils\:/util-linux/
398 .SH ENVIRONMENT VARIABLES
401 program's behavior is affected by the following environment variables:
403 .B FSCK_FORCE_ALL_PARALLEL
404 If this environment variable is set,
406 will attempt to check all of the specified filesystems in parallel, regardless of
407 whether the filesystems appear to be on the same device. (This is useful for
408 RAID systems or high-end storage systems such as those sold by companies such
409 as IBM or EMC.) Note that the fs_passno value is still used.
412 This environment variable will limit the maximum number of filesystem
413 checkers that can be running at one time. This allows configurations
414 which have a large number of disks to avoid
416 starting too many filesystem checkers at once, which might overload
417 CPU and memory resources available on the system. If this value is
418 zero, then an unlimited number of processes can be spawned. This is
419 currently the default, but future versions of
421 may attempt to automatically determine how many filesystem checks can
422 be run based on gathering accounting data from the operating system.
427 environment variable is used to find filesystem checkers. A set of
428 system directories are searched first:
435 Then the set of directories found in the
437 environment are searched.
440 This environment variable allows the system administrator
441 to override the standard location of the
443 file. It is also useful for developers who are testing