Whamcloud - gitweb
ChangeLog, fsck.8.in:
[tools/e2fsprogs.git] / misc / fsck.8.in
1 .\" -*- nroff -*-
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.
4 .\" 
5 .TH FSCK 8 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
6 .SH NAME
7 fsck \- check and repair a Linux file system
8 .SH SYNOPSIS
9 .B fsck
10 [
11 .B \-sACVRTNP
12 ]
13 [
14 .B \-t
15 .I fstype
16 ] [\-\-] [
17 .B fsck-options
18 ]
19 .I filesys [ ... ]
20 .SH DESCRIPTION
21 .B fsck
22 is used to check and optionally repair a one or more Linux file systems.  
23 .I filesys
24 can be a device name (e.g.
25 .IR /dev/hdc1 ", " /dev/sdb2 ),
26 a mount point (e.g.
27 .IR / ", " /usr ", " /home ),
28 or an ext2 label or UUID specifier (e.g.
29 UUID=8868abf6-88c5-4a83-98b8-bfc24057f7bd or LABEL=root).  
30 The 
31 .B fsck 
32 program will try to run filesystems on different physical disk drives 
33 in parallel to reduce total amount time to check all of the filesystems.
34 .PP
35 The exit code returned by
36 .B fsck
37 is the sum of the following conditions:
38 .br
39 \       0\      \-\ No errors
40 .br
41 \       1\      \-\ File system errors corrected
42 .br
43 \       2\      \-\ System should be rebooted
44 .br
45 \       4\      \-\ File system errors left uncorrected
46 .br
47 \       8\      \-\ Operational error
48 .br
49 \       16\     \-\ Usage or syntax error
50 .br
51 \       128\    \-\ Shared library error
52 .br
53 The exit code returned when all file systems are checked using the
54 .B \-A
55 option is the bit-wise OR of the exit codes for each
56 file system that is checked.
57 .PP
58 In actuality,
59 .B fsck
60 is simply a front-end for the various file system checkers
61 (\fBfsck\fR.\fIfstype\fR) available under Linux.  The file
62 system-specific checker is searched for in
63 .I /sbin
64 first, then in
65 .I /etc/fs
66 and
67 .IR /etc ,
68 and finally in the directories listed in the PATH environment
69 variable.  Please see the file system-specific checker manual pages for
70 further details.
71 .SH OPTIONS
72 .TP
73 .B \-s
74 Serialize 
75 .B fsck 
76 operations.  This is a good idea if you checking multiple
77 filesystems and the checkers are in an interactive mode.  (Note:
78 .BR e2fsck (8)
79 runs in an interactive mode by default.  To make 
80 .BR e2fsck (8)
81 run in a non-interactive mode, you must either specify the
82 .B \-p
83 or
84 .B \-a
85 option, if you wish for errors to be corrected automatically, or the 
86 .B \-n
87 option if you do not.)
88 .TP
89 .BI \-t " fstype"
90 Specifies the type of file system to be checked.  When the
91 .B \-A 
92 flag is specified, only filesystems that match 
93 .I fstype
94 are checked.  If 
95 .I fstype
96 is prefixed with 
97 .I no
98 then only filesystems whose type does not match
99 .I fstype
100 are checked.
101 .sp
102 Normally, the filesystem type is deduced by searching for
103 .I filesys
104 in the 
105 .I /etc/fstab 
106 file and using the corresponding entry.
107 If the type can not be deduced, 
108 .B fsck
109 will use the type specified by the 
110 .B \-t
111 option if it specifies a unique filesystem type.  If this type is not
112 available, then the default file system type (currently ext2) is used. 
113 .TP
114 .B \-A
115 Walk through the
116 .I /etc/fstab
117 file and try to check all file systems in one run.  This option is
118 typically used from the
119 .I /etc/rc
120 system initalization file, instead of multiple commands for checking
121 a single file system.
122 .sp
123 The root filesystem will be checked first unless the
124 .B \-P
125 option is specified (see below).  After that, 
126 filesystems will be checked in the order specified by the 
127 .I fs_passno 
128 (the sixth) field in the 
129 .I /etc/fstab
130 file.  
131 Filesystems with a 
132 .I fs_passno
133 value of 0 are skipped and are not checked at all.
134 If there are multiple filesystems with the same pass number, 
135 e2fsck will attempt to check them in parallel, although it will avoid running 
136 multiple filesystem checks on the same physical disk.  
137 Hence, 
138 a very common configuration in 
139 .I /etc/fstab
140 files is to set the root filesystem to have a 
141 .I fs_passno
142 value of 1
143 and to set all filesystems to have a
144 .I fs_passno
145 value of 2.  This will allow
146 .B fsck
147 to automatically run filesystem checkers in parallel if it is advantageous
148 to do so.  System administrators might choose
149 not to use this configuration  if they need to avoid multiple filesystem
150 checks running in parallel for some reason --- for example, if the
151 machine in question is short on memory so that
152 excessive paging is a concern.
153 .TP
154 .B \-C
155 Display completion/progress bars for those filesystems checkers (currently
156 only for ext2) which support them.   Fsck will manage the filesystem checkers
157 so that only one of them will display a progress bar at a time.
158 .TP
159 .B \-N
160 Don't execute, just show what would be done.
161 .TP
162 .B \-P
163 When the 
164 .B \-A
165 flag is set, check the root filesystem in parallel with the other filesystems.
166 This is not the safest thing in the world to do,
167 since if the root filesystem is in doubt things like the 
168 .BR e2fsck (8) 
169 executable might be corrupted!  This option is mainly provided
170 for those sysadmins who don't want to repartition the root
171 filesystem to be small and compact (which is really the right solution).
172 .TP
173 .B \-R
174 When checking all file systems with the
175 .B \-A
176 flag, skip the root file system (in case it's already mounted read-write).
177 .TP
178 .B \-T
179 Don't show the title on startup.
180 .TP
181 .B \-V
182 Produce verbose output, including all file system-specific commands
183 that are executed.
184 .TP
185 .B fsck-options
186 Any options which are not understood by 
187 .BR fsck ,
188 or which follow the
189 .B \-\-
190 option are treated as file system-specific options to be passed to the
191 file system-specific checker.
192 .PP
193 Currently, standardized file system-specific options are somewhat in
194 flux.  Although not guaranteed, the following options are supported
195 by most file system checkers:
196 .TP
197 .B \-a
198 Automatically repair the file system without any questions (use
199 this option with caution).  Note that 
200 .BR e2fsck (8)
201 supports 
202 .B \-a
203 for backwards compatibility only.  This option is mapped to 
204 .BR e2fsck 's
205 .B \-p
206 option which is safe to use, unlike the 
207 .B \-a 
208 option that most file system checkers support.
209 .TP
210 .B \-r
211 Interactively repair the filesystem (ask for confirmations).  Note: It
212 is generally a bad idea to use this option if multiple fsck's are being
213 run in parallel.  Also note that this is 
214 .BR e2fsck 's
215 default behavior; it supports this option for backwards compatibility
216 reasons only.
217 .SH AUTHOR
218 Theodore Ts'o (tytso@mit.edu)
219 .PP
220 The manual page was shamelessly adapted from David Engel and Fred van
221 Kempen's generic 
222 .B fsck
223 front end program, which was in turn shamelessly
224 adapted from Remy Card's version for the ext2 file system.
225 .SH FILES
226 .IR /etc/fstab .
227 .SH SEE ALSO
228 .BR fstab (5),
229 .BR mkfs (8),
230 .BR fsck.minix (8),
231 .BR fsck.ext2 (8)
232 or
233 .BR e2fsck (8),
234 .BR fsck.xiafs (8).