blob: 58d23b980d39cf847647a968072ac46ae4893aa1 [file] [log] [blame]
Theodore Ts'o3839e651997-04-26 13:21:57 +00001.\" -*- nroff -*-
Theodore Ts'oa418d3a1997-04-26 14:00:26 +00002.\" 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.
4.\"
Theodore Ts'o74becf31997-04-26 14:37:06 +00005.TH FSCK 8 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
Theodore Ts'o3839e651997-04-26 13:21:57 +00006.SH NAME
7fsck \- check and repair a Linux file system
8.SH SYNOPSIS
9.B fsck
10[
Theodore Ts'o7f88b041997-04-26 14:48:50 +000011.B \-AVRTNP
Theodore Ts'o3839e651997-04-26 13:21:57 +000012]
13[
Theodore Ts'of3db3561997-04-26 13:34:30 +000014.B \-s
Theodore Ts'o3839e651997-04-26 13:21:57 +000015]
16[
17.B \-t
18.I fstype
19]
20[
21.B fs-options
22]
23.I filesys [ ... ]
24.SH DESCRIPTION
25.B fsck
26is used to check and optionally repair a Linux file system.
27.I filesys
28is either the device name (e.g. /dev/hda1, /dev/sdb2) or the mount point
Theodore Ts'o583ccdc1997-05-09 03:06:31 +000029(e.g. /, /usr, /home) for the file system. If this invocation of
30.B fsck
31has several filesystems on different physical disk drives to check, then
32.B fsck
33will try to run them in parallel. This reduces the total amount time it
34takes to check all of the filesystems, since
35.B fsck
36takes advantage of the parallelism of multiple disk spindles.
Theodore Ts'o3839e651997-04-26 13:21:57 +000037.PP
38The exit code returned by
39.B fsck
40is the sum of the following conditions:
41.br
42\ 0\ \-\ No errors
43.br
44\ 1\ \-\ File system errors corrected
45.br
46\ 2\ \-\ System should be rebooted
47.br
48\ 4\ \-\ File system errors left uncorrected
49.br
50\ 8\ \-\ Operational error
51.br
52\ 16\ \-\ Usage or syntax error
53.br
54\ 128\ \-\ Shared library error
55.br
56The exit code returned when all file systems are checked using the
57.B -A
58option is the bit-wise OR of the exit codes for each
59file system that is checked.
60.PP
61In actuality,
62.B fsck
63is simply a front-end for the various file system checkers
64(\fBfsck\fR.\fIfstype\fR) available under Linux. The file
65system-specific checker is searched for in /sbin first, then in /etc/fs
66and /etc, and finally in the directories listed in the PATH environment
67variable. Please see the file system-specific checker manual pages for
68further details.
69.SH OPTIONS
70.TP
71.B -A
72Walk through the
73.I /etc/fstab
74file and try to check all file systems in one run. This option is
75typically used from the
76.I /etc/rc
77system initalization file, instead of multiple commands for checking
Theodore Ts'of3db3561997-04-26 13:34:30 +000078a single file system.
79.TP
80.B -R
81When checking all file systems with the
82.B \-A
83flag, skip the root file system (in case it's already mounted read-write).
84.TP
85.B -T
86Don't show the title on startup.
87.TP
88.B -N
89Don't execute, just show what would be done.
Theodore Ts'o3839e651997-04-26 13:21:57 +000090.TP
Theodore Ts'o7f88b041997-04-26 14:48:50 +000091.B -P
92When the
93.B -A
94flag is set, check the root filesystem in parallel with the other filesystems.
95This is not the safest thing in the world to do,
Theodore Ts'o583ccdc1997-05-09 03:06:31 +000096since if the root filesystem is in doubt things like the
97.BR e2fsck (8)
98executable might be corrupted! This option is mainly provided
Theodore Ts'o7f88b041997-04-26 14:48:50 +000099for those sysadmins who don't want to repartition the root
100filesystem to be small and compact (which is really the right solution).
101.TP
Theodore Ts'o3839e651997-04-26 13:21:57 +0000102.B -s
Theodore Ts'o583ccdc1997-05-09 03:06:31 +0000103Serialize
104.B fsck
105operations. This is a good idea if you checking multiple
106filesystems and the checkers are in an interactive mode. (Note:
107.BR e2fsck (8)
Theodore Ts'o3839e651997-04-26 13:21:57 +0000108runs in an interactive mode by default. To make
Theodore Ts'o583ccdc1997-05-09 03:06:31 +0000109.BR e2fsck (8)
Theodore Ts'o3839e651997-04-26 13:21:57 +0000110run in a non-interactive mode, you must either specify the
111.B -p
112or
113.B -a
114option, if you wish for errors to be corrected automatically, or
115the
116.B -n
117option if you do not.)
118.TP
119.B -V
120Produce verbose output, including all file system-specific commands
121that are executed.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000122.TP
123.BI -t \ fstype
Theodore Ts'of3db3561997-04-26 13:34:30 +0000124Specifies the type of file system to be checked. When the
125.B \-A
126flag is specified, only filesystems that match
127.I fstype
128are checked. If
129.I fstype
130is prefixed with
131.B no
Theodore Ts'o583ccdc1997-05-09 03:06:31 +0000132then only filesystems whose type does not match
Theodore Ts'of3db3561997-04-26 13:34:30 +0000133.I fstype
134are checked.
135.sp
136Normally, the filesystem type is deduced by searching for
Theodore Ts'o3839e651997-04-26 13:21:57 +0000137.I filesys
Theodore Ts'of3db3561997-04-26 13:34:30 +0000138in the
139.I /etc/fstab
140file and using the corresponding entry.
141If the type can not be deduced,
142.B fsck
143will use the type specified by the
144.B \-t
145option if it specifies a unique filesystem type. If this type is not
Theodore Ts'o583ccdc1997-05-09 03:06:31 +0000146available, then the default file system type (currently ext2) is used.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000147.TP
148.B fs-options
149Any options which are not understood by
150.BR fsck ,
151or which follow the
152.B --
153option are treated as file system-specific options to be passed to the
Theodore Ts'of3db3561997-04-26 13:34:30 +0000154file system-specific checker.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000155.PP
156Currently, standardized file system-specific options are somewhat in
157flux. Although not guaranteed, the following options are supported
Theodore Ts'o583ccdc1997-05-09 03:06:31 +0000158by most file system checkers:
Theodore Ts'o3839e651997-04-26 13:21:57 +0000159.TP
160.B -a
161Automatically repair the file system without any questions (use
162this option with caution). Note that
Theodore Ts'o583ccdc1997-05-09 03:06:31 +0000163.BR e2fsck (8)
Theodore Ts'o3839e651997-04-26 13:21:57 +0000164supports
165.B -a
Theodore Ts'o583ccdc1997-05-09 03:06:31 +0000166for backwards compatibility only. This option is mapped to
167.BR e2fsck 's
Theodore Ts'o3839e651997-04-26 13:21:57 +0000168.B -p
169option which is safe to use, unlike the
170.B -a
171option that most file system checkers support.
172.TP
173.B -r
174Interactively repair the filesystem (ask for confirmations). Note: It
175is generally a bad idea to use this option if multiple fsck's are being
176run in parallel. Also note that this is
Theodore Ts'o583ccdc1997-05-09 03:06:31 +0000177.BR e2fsck 's
Theodore Ts'o3839e651997-04-26 13:21:57 +0000178default behavior; it supports this option for backwards compatibility
179reasons only.
180.SH AUTHOR
181Theodore Ts'o (tytso@mit.edu)
182.PP
183The manual page was shamelessly adapted from David Engel and Fred van
Theodore Ts'o583ccdc1997-05-09 03:06:31 +0000184Kempen's generic
185.B fsck
186front end program, which was in turn shamelessly
Theodore Ts'o3839e651997-04-26 13:21:57 +0000187adapted from Remy Card's version for the ext2 file system.
Theodore Ts'of3db3561997-04-26 13:34:30 +0000188.SH FILES
189.IR /etc/fstab .
Theodore Ts'o3839e651997-04-26 13:21:57 +0000190.SH SEE ALSO
Theodore Ts'of3db3561997-04-26 13:34:30 +0000191.BR fstab (5),
Theodore Ts'o3839e651997-04-26 13:21:57 +0000192.BR mkfs (8),
193.BR fsck.minix (8),
194.BR fsck.ext2 (8)
195or
196.BR e2fsck (8),
197.BR fsck.xiafs (8).