2
2
.\" Copyright 1993, 1994, 1995 by Theodore Ts'o. All Rights Reserved.
3
3
.\" This file may be copied under the terms of the GNU Public License.
5
.TH FSCK 8 "February 2009" "Linux" "MAINTENANCE COMMANDS"
5
.TH FSCK 8 "February 2009" "util-linux" "System Administration"
7
fsck \- check and repair a Linux file system
7
fsck \- check and repair a Linux filesystem
10
10
.RB [ \-lsAVRTMNP ]
17
17
.RI [ fs-specific-options ]
20
is used to check and optionally repair one or more Linux file systems.
20
is used to check and optionally repair one or more Linux filesystems.
22
22
can be a device name (e.g.
23
23
.IR /dev/hdc1 ", " /dev/sdb2 ),
30
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 the
31
in parallel to reduce the total amount of time needed to check all of them.
34
33
If no filesystems are specified on the command line, and the
50
\ 1\ \-\ File system errors corrected
49
\ 1\ \-\ Filesystem errors corrected
52
51
\ 2\ \-\ System should be rebooted
54
\ 4\ \-\ File system errors left uncorrected
53
\ 4\ \-\ Filesystem errors left uncorrected
56
55
\ 8\ \-\ Operational error
60
59
\ 32\ \-\ Fsck canceled by user request
62
\ 128\ \-\ Shared library error
61
\ 128\ \-\ Shared-library error
64
The exit code returned when multiple file systems are checked
63
The exit code returned when multiple filesystems are checked
65
64
is the bit-wise OR of the exit codes for each
66
file system that is checked.
65
filesystem that is checked.
70
is simply a front-end for the various file system checkers
71
(\fBfsck\fR.\fIfstype\fR) available under Linux. The file
72
system-specific checker is searched for in
69
is simply a front-end for the various filesystem checkers
70
(\fBfsck\fR.\fIfstype\fR) available under Linux. The
71
filesystem-specific checker is searched for in
78
77
and finally in the directories listed in the PATH environment
79
variable. Please see the file system-specific checker manual pages for
78
variable. Please see the filesystem-specific checker manual pages for
84
Lock whole-disk device by exclusive
83
Lock the whole-disk device by an exclusive
86
This option can be used with one device only (e.g. -A and -l are mutually
87
exclusive). This option is recommended when more
85
This option can be used with one device only (this means that \fB-A\fR and
86
\fB-l\fR are mutually exclusive). This option is recommended when more
89
instances are executed in the same time. The option is ignored when used for
90
multiple devices or for non-rotating disk. The fsck does not lock underlying
91
devices if executed to check stacked devices (e.g. MD or DM) -- this feature is
88
instances are executed in the same time. The option is ignored when used for
89
multiple devices or for non-rotating disks. \fBfsck\fR does not lock underlying
90
devices when executed to check stacked devices (e.g. MD or DM) -- this feature is
92
91
not implemented yet.
123
122
which requests that only those filesystems not listed in
125
will be checked. If all of the filesystems in
127
are not prefixed by a negation operator, then only those filesystems
124
will be checked. If none of the filesystems in
126
is prefixed by a negation operator, then only those listed filesystems
133
129
Options specifiers may be included in the comma-separated
182
178
will use the specified filesystem type. If this type is not
183
available, then the default file system type (currently ext2) is used.
179
available, then the default filesystem type (currently ext2) is used.
188
file and try to check all file systems in one run. This option is
184
file and try to check all filesystems in one run. This option is
189
185
typically used from the
191
187
system initialization file, instead of multiple commands for checking
192
a single file system.
194
190
The root filesystem will be checked first unless the
215
211
does not check stacked devices (RAIDs, dm-crypt, ...) in parallel with any other
216
device. See below for FSCK_FORCE_ALL_PARALLEL setting. The /sys filesystem is
212
device. See below for FSCK_FORCE_ALL_PARALLEL setting. The /sys filesystem is
217
213
used to detemine dependencies between devices.
219
215
Hence, a very common configuration in
236
232
normally does not check whether the device actually exists before
237
calling a file system specific checker. Therefore non-existing
238
devices may cause the system to enter file system repair mode during
239
boot if the filesystem specific checker returns a fatal error. The
233
calling a filesystem specific checker. Therefore non-existing
234
devices may cause the system to enter filesystem repair mode during
235
boot if the filesystem specific checker returns a fatal error. The
275
271
filesystem to be small and compact (which is really the right solution).
278
When checking all file systems with the
274
When checking all filesystems with the
280
flag, skip the root file system (in case it's already mounted read-write).
276
flag, skip the root filesystem. (This is useful in case the root
277
filesystem has already been mounted read-write.)
283
280
Don't show the title on startup.
286
Produce verbose output, including all file system-specific commands
283
Produce verbose output, including all filesystem-specific commands
287
284
that are executed.
289
286
.B fs-specific-options
294
291
not take arguments, as there is no
297
to be able to properly guess which arguments take options and which
294
to be able to properly guess which options take arguments and which
300
297
Options and arguments which follow the
302
are treated as file system-specific options to be passed to the
303
file system-specific checker.
299
are treated as filesystem-specific options to be passed to the
300
filesystem-specific checker.
305
302
Please note that fsck is not
306
303
designed to pass arbitrarily complicated options to filesystem-specific
307
304
checkers. If you're doing something complicated, please just
308
305
execute the filesystem-specific checker directly. If you pass
310
some horribly complicated option and arguments, and it doesn't do
307
some horribly complicated options and arguments, and it doesn't do
312
309
.B don't bother reporting it as a bug.
313
310
You're almost certainly doing something that you shouldn't be doing
317
314
Options to different filesystem-specific fsck's are not standardized.
318
315
If in doubt, please consult the man pages of the filesystem-specific
319
316
checker. Although not guaranteed, the following options are supported
320
by most file system checkers:
317
by most filesystem checkers:
323
Automatically repair the file system without any questions (use
320
Automatically repair the filesystem without any questions (use
324
321
this option with caution). Note that
328
for backwards compatibility only. This option is mapped to
325
for backward compatibility only. This option is mapped to
331
328
option which is safe to use, unlike the
333
option that some file system checkers support.
330
option that some filesystem checkers support.
336
333
For some filesystem-specific checkers, the
350
347
is generally a bad idea to use this option if multiple fsck's are being
351
348
run in parallel. Also note that this is
353
default behavior; it supports this option for backwards compatibility
350
default behavior; it supports this option for backward compatibility
382
379
.B FSCK_FORCE_ALL_PARALLEL
383
380
If this environment variable is set,
385
will attempt to run all of the specified filesystems in parallel, regardless of
382
will attempt to check all of the specified filesystems in parallel, regardless of
386
383
whether the filesystems appear to be on the same device. (This is useful for
387
384
RAID systems or high-end storage systems such as those sold by companies such
388
as IBM or EMC.) Note that the fs_passno value is still used.
385
as IBM or EMC.) Note that the fs_passno value is still used.
391
This environment variable will limit the maximum number of file system
388
This environment variable will limit the maximum number of filesystem
392
389
checkers that can be running at one time. This allows configurations
393
390
which have a large number of disks to avoid
395
starting too many file system checkers at once, which might overload
392
starting too many filesystem checkers at once, which might overload
396
393
CPU and memory resources available on the system. If this value is
397
394
zero, then an unlimited number of processes can be spawned. This is
398
395
currently the default, but future versions of
400
may attempt to automatically determine how many file system checks can
397
may attempt to automatically determine how many filesystem checks can
401
398
be run based on gathering accounting data from the operating system.
406
environment variable is used to find file system checkers. A set of
403
environment variable is used to find filesystem checkers. A set of
407
404
system directories are searched first: