~ubuntu-branches/ubuntu/trusty/util-linux/trusty-proposed

« back to all changes in this revision

Viewing changes to fsck/fsck.8

  • Committer: Package Import Robot
  • Author(s): LaMont Jones
  • Date: 2011-11-03 15:38:23 UTC
  • mto: (4.5.5 sid) (1.6.4)
  • mto: This revision was merged to the branch mainline in revision 85.
  • Revision ID: package-import@ubuntu.com-20111103153823-10sx16jprzxlhkqf
ImportĀ upstreamĀ versionĀ 2.20.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
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.
4
4
.\"
5
 
.TH FSCK 8 "February 2009" "Linux" "MAINTENANCE COMMANDS"
 
5
.TH FSCK 8 "February 2009" "util-linux" "System Administration"
6
6
.SH NAME
7
 
fsck \- check and repair a Linux file system
 
7
fsck \- check and repair a Linux filesystem
8
8
.SH SYNOPSIS
9
9
.B fsck
10
10
.RB [ \-lsAVRTMNP ]
17
17
.RI [ fs-specific-options ]
18
18
.SH DESCRIPTION
19
19
.B fsck
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.
21
21
.I filesys
22
22
can be a device name (e.g.
23
23
.IR /dev/hdc1 ", " /dev/sdb2 ),
28
28
Normally, the
29
29
.B fsck
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
32
 
filesystems.
 
31
in parallel to reduce the total amount of time needed to check all of them.
33
32
.PP
34
33
If no filesystems are specified on the command line, and the
35
34
.B \-A
47
46
.br
48
47
\       0\      \-\ No errors
49
48
.br
50
 
\       1\      \-\ File system errors corrected
 
49
\       1\      \-\ Filesystem errors corrected
51
50
.br
52
51
\       2\      \-\ System should be rebooted
53
52
.br
54
 
\       4\      \-\ File system errors left uncorrected
 
53
\       4\      \-\ Filesystem errors left uncorrected
55
54
.br
56
55
\       8\      \-\ Operational error
57
56
.br
59
58
.br
60
59
\       32\     \-\ Fsck canceled by user request
61
60
.br
62
 
\       128\    \-\ Shared library error
 
61
\       128\    \-\ Shared-library error
63
62
.br
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.
67
66
.PP
68
67
In actuality,
69
68
.B fsck
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
73
72
.I /sbin
74
73
first, then in
75
74
.I /etc/fs
76
75
and
77
76
.IR /etc ,
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
80
79
further details.
81
80
.SH OPTIONS
82
81
.TP
83
82
.B \-l
84
 
Lock whole-disk device by exclusive
 
83
Lock the whole-disk device by an exclusive
85
84
.BR flock (2).
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
88
87
.B fsck (8)
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.
93
92
.TP
94
93
.B \-s
108
107
option if you do not.)
109
108
.TP
110
109
.BI \-t " fslist"
111
 
Specifies the type(s) of file system to be checked.  When the
 
110
Specifies the type(s) of filesystem to be checked.  When the
112
111
.B \-A
113
112
flag is specified, only filesystems that match
114
113
.I fslist
122
121
.RB ' ! ',
123
122
which requests that only those filesystems not listed in
124
123
.I fslist
125
 
will be checked.  If all of the filesystems in
126
 
.I fslist
127
 
are not prefixed by a negation operator, then only those filesystems
128
 
listed
129
 
in
130
 
.I fslist
 
124
will be checked.  If none of the filesystems in
 
125
.I fslist
 
126
is prefixed by a negation operator, then only those listed filesystems
131
127
will be checked.
132
128
.sp
133
129
Options specifiers may be included in the comma-separated
180
176
option,
181
177
.B fsck
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.
184
180
.TP
185
181
.B \-A
186
182
Walk through the
187
183
.I /etc/fstab
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
190
186
.I /etc/rc
191
187
system initialization file, instead of multiple commands for checking
192
 
a single file system.
 
188
a single filesystem.
193
189
.sp
194
190
The root filesystem will be checked first unless the
195
191
.B \-P
213
209
.sp
214
210
.B fsck
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.
218
214
.sp
219
215
Hence, a very common configuration in
234
230
.sp
235
231
.B fsck
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
240
236
.B /etc/fstab
241
237
mount option
242
238
.B nofail
244
240
.B fsck
245
241
skip non-existing devices.
246
242
.B fsck
247
 
also skips non-existing devices that have the special file system type
 
243
also skips non-existing devices that have the special filesystem type
248
244
.B auto
249
245
.
250
246
.TP
275
271
filesystem to be small and compact (which is really the right solution).
276
272
.TP
277
273
.B \-R
278
 
When checking all file systems with the
 
274
When checking all filesystems with the
279
275
.B \-A
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.)
281
278
.TP
282
279
.B \-T
283
280
Don't show the title on startup.
284
281
.TP
285
282
.B \-V
286
 
Produce verbose output, including all file system-specific commands
 
283
Produce verbose output, including all filesystem-specific commands
287
284
that are executed.
288
285
.TP
289
286
.B fs-specific-options
294
291
not take arguments, as there is no
295
292
way for
296
293
.B fsck
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
298
295
don't.
299
296
.IP
300
297
Options and arguments which follow the
301
298
.B \-\-
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.
304
301
.IP
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
309
306
.B fsck
310
 
some horribly complicated option and arguments, and it doesn't do
 
307
some horribly complicated options and arguments, and it doesn't do
311
308
what you expect,
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:
321
318
.TP
322
319
.B \-a
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
325
322
.BR e2fsck (8)
326
323
supports
327
324
.B \-a
328
 
for backwards compatibility only.  This option is mapped to
 
325
for backward compatibility only.  This option is mapped to
329
326
.BR e2fsck 's
330
327
.B \-p
331
328
option which is safe to use, unlike the
332
329
.B \-a
333
 
option that some file system checkers support.
 
330
option that some filesystem checkers support.
334
331
.TP
335
332
.B \-n
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
352
349
.BR e2fsck 's
353
 
default behavior; it supports this option for backwards compatibility
 
350
default behavior; it supports this option for backward compatibility
354
351
reasons only.
355
352
.TP
356
353
.B \-y
364
361
.BR fsck.minix (8)
365
362
and
366
363
.BR fsck.cramfs (8)
367
 
does not support the
 
364
do not support the
368
365
.B -y
369
366
option as of this writing.
370
367
.SH AUTHOR
382
379
.B FSCK_FORCE_ALL_PARALLEL
383
380
If this environment variable is set,
384
381
.B fsck
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.
389
386
.TP
390
387
.B FSCK_MAX_INST
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
394
391
.B fsck
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
399
396
.B fsck
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.
402
399
.TP
403
400
.B PATH
404
401
The
405
402
.B PATH
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:
408
405
.BR /sbin ,
409
406
.BR /sbin/fs.d ,
410
 
.BR  /sbin/fs ,
 
407
.BR /sbin/fs ,
411
408
.BR /etc/fs ,
412
409
and
413
410
.BR /etc .