Whamcloud - gitweb
Update and clarify man pages (addresses Debian Bug #145044).
[tools/e2fsprogs.git] / e2fsck / e2fsck.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 E2FSCK 8 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
6 .SH NAME
7 e2fsck \- check a Linux second extended file system
8 .SH SYNOPSIS
9 .B e2fsck
10 [
11 .B \-pacnyrdfvstFSV
12 ]
13 [
14 .B \-b
15 .I superblock
16 ]
17 [
18 .B \-B
19 .I blocksize
20 ]
21 [
22 .BR \-l | \-L
23 .I bad_blocks_file
24 ]
25 [
26 .B \-C
27 .I fd
28 ]
29 @JDEV@[
30 @JDEV@.B \-j
31 @JDEV@.I external-journal
32 @JDEV@]
33 [
34 .B \-E
35 .I extended_options
36 ]
37 .I device
38 .SH DESCRIPTION
39 .B e2fsck
40 is used to check a Linux second extended file system (ext2fs).  
41 .B E2fsck
42 also 
43 supports ext2 filesystems countaining a journal, which are
44 also sometimes known as ext3 filesystems, by first applying the journal 
45 to the filesystem before continuing with normal 
46 .B e2fsck
47 processing.  After the journal has been applied, a filesystem will
48 normally be marked as clean.  Hence, for ext3 filesystems, 
49 .B e2fsck
50 will normally run the journal and exit, unless its superblock
51 indicates that further checking is required.
52 .PP
53 .I device
54 is the device file where the filesystem is stored (e.g.
55 .IR /dev/hdc1 ).
56 .SH OPTIONS
57 .TP
58 .B \-a 
59 This option does the same thing as the 
60 .B \-p
61 option.  It is provided for backwards compatibility only; it is
62 suggested that people use 
63 .B \-p 
64 option whenever possible.
65 .TP
66 .BI \-b " superblock"
67 Instead of using the normal superblock, use an alternative superblock
68 specified by 
69 .IR superblock .
70 This option is normally used when the primary superblock has been
71 corrupted.  The location of the backup superblock is dependent on the
72 filesystem's blocksize.  For filesystems with 1k blocksizes, a backup
73 superblock can be found at block 8193; for filesystems with 2k
74 blocksizes, at block 16384; and for 4k blocksizes, at block 32768.  
75 .IP
76 Additional backup superblocks can be determined by using the 
77 .B mke2fs 
78 program using the 
79 .B \-n
80 option to print out where the superblocks were created.   The 
81 .B \-b 
82 option to 
83 .BR mke2fs ,
84 which specifies blocksize of the filesystem must be specified in order
85 for the superblock locations that are printed out to be accurate.
86 .IP
87 If an alternative superblock is specified and  
88 the filesystem is not opened read-only, e2fsck will make sure that the
89 primary superblock is updated appropriately upon completion of the 
90 filesystem check.
91 .TP
92 .BI \-B " blocksize"
93 Normally, 
94 .B e2fsck
95 will search for the superblock at various different
96 block sizes in an attempt to find the appropriate block size.
97 This search can be fooled in some cases.  This option forces 
98 .B e2fsck
99 to only try locating the superblock at a particular blocksize.
100 If the superblock is not found, 
101 .B e2fsck 
102 will terminate with a fatal error.
103 .TP
104 .B \-c
105 This option causes 
106 .B e2fsck 
107 to run the 
108 .BR badblocks (8)
109 program to find any blocks which are bad on the filesystem, 
110 and then marks them as bad by adding them to the bad block inode.
111 If this option is specified twice, then the bad block scan will be done
112 using a non-destructive read-write test.
113 .TP
114 .B \-C
115 This option causes
116 .B e2fsck
117 to write completion information to the specified file descriptor 
118 so that the progress of the filesystem 
119 check can be monitored.  This option is typically used by programs 
120 which are running
121 .BR e2fsck .
122 If the file descriptor specified is 0, 
123 .B e2fsck
124 will print a completion bar as it goes about its business.  This requires
125 that e2fsck is running on a video console or terminal.
126 .TP
127 .B \-d
128 Print debugging output (useless unless you are debugging
129 .BR e2fsck ).
130 .TP
131 .B \-D
132 Optimize directories in filesystem.  This option causes e2fsck to
133 try to optimize all directories, either by reindexing them if the
134 filesystem supports directory indexing,  or by sorting and compressing
135 directories for smaller directories, or for filesystems using
136 traditional linear directories.
137 .TP
138 .BI \-E " extended_options"
139 Set e2fsck extended options.  Extended options are comma
140 separated, and may take an argument using the equals ('=') sign.  The 
141 following options are supported:
142 .RS 1.2i
143 .TP
144 .BI ea_ver= extended_attribute_version
145 Assume the format of the extended attribute blocks in the filesystem is
146 the specified version number.  The version number may be 1 or 2.  The
147 default extended attribute version format is 2.
148 .RE
149 .TP
150 .B \-f
151 Force checking even if the file system seems clean.
152 .TP
153 .B \-F
154 Flush the filesystem device's buffer caches before beginning.  Only
155 really useful for doing 
156 .B e2fsck 
157 time trials.
158 @JDEV@.TP
159 @JDEV@.BI \-j " external-journal"
160 @JDEV@Set the pathname where the external-journal for this filesystem can be
161 @JDEV@found.
162 .TP
163 .BI \-l " filename"
164 Add the block numbers listed in the file specified by 
165 .I filename
166 to the list of bad blocks.  The format of this file is the same as the
167 one generated by the 
168 .BR badblocks (8)
169 program.  Note that the block numbers are based on the blocksize
170 of the filesystem.  Hence, 
171 .BR badblocks (8)
172 must be given the blocksize of the filesystem in order to obtain correct
173 results.  As a result, it is much simpler and safer to use the 
174 .B -c
175 option to 
176 .BR e2fsck ,
177 since it will assure that the correct parameters are passed to the
178 .B badblocks
179 program.
180 .TP
181 .BI \-L " filename"
182 Set the bad blocks list to be the list of blocks specified by 
183 .IR filename .
184 (This option is the same as the 
185 .B \-l
186 option, except the bad blocks list is cleared before the blocks listed
187 in the file are added to the bad blocks list.)
188 .TP
189 .B \-n
190 Open the filesystem read-only, and assume an answer of `no' to all
191 questions.  Allows
192 .B e2fsck
193 to be used non-interactively.  (Note: if the 
194 .BR \-c ,
195 .BR \-l ,
196 or
197 .B \-L
198 options are specified in addition to the 
199 .B \-n
200 option, then the filesystem will be opened read-write, to permit the
201 bad-blocks list to be updated.  However, no other changes will be made
202 to the filesystem.)
203 .TP
204 .B \-p
205 Automatically repair ("preen") the file system without any questions.
206 .TP
207 .B \-r
208 This option does nothing at all; it is provided only for backwards
209 compatibility.
210 .TP 
211 .B \-s
212 This option will byte-swap the filesystem so that it is using the normalized, 
213 standard byte-order (which is i386 or little endian).  If the filesystem is
214 already in the standard byte-order, 
215 .B e2fsck 
216 will take no action.
217 .TP
218 .B \-S
219 This option will byte-swap the filesystem, regardless of its current 
220 byte-order.
221 .TP
222 .B \-t
223 Print timing statistics for
224 .BR e2fsck .
225 If this option is used twice, additional timing statistics are printed
226 on a pass by pass basis.
227 .TP
228 .B \-v
229 Verbose mode.
230 .TP
231 .B \-V
232 Print version information and exit.
233 .TP
234 .B \-y
235 Assume an answer of `yes' to all questions; allows 
236 .B e2fsck
237 to be used non-interactively.
238 .SH EXIT CODE
239 The exit code returned by
240 .B e2fsck
241 is the sum of the following conditions:
242 .br
243 \       0\      \-\ No errors
244 .br
245 \       1\      \-\ File system errors corrected
246 .br
247 \       2\      \-\ File system errors corrected, system should
248 .br
249 \       \       \ \ be rebooted
250 .br
251 \       4\      \-\ File system errors left uncorrected
252 .br
253 \       8\      \-\ Operational error
254 .br
255 \       16\     \-\ Usage or syntax error
256 .br
257 \       32\     \-\ E2fsck canceled by user request
258 .br
259 \       128\    \-\ Shared library error
260 .br
261 .SH SIGNALS
262 The following signals have the following effect when sent to 
263 .BR e2fsck .
264 .TP
265 .B SIGUSR1
266 This signal causes
267 .B e2fsck
268 to start displaying a completion bar.  (See discussion of the 
269 .B \-C
270 option.)
271 .TP
272 .B SIGUSR2
273 This signal causes
274 .B e2fsck 
275 to stop displaying a completion bar.
276 .SH REPORTING BUGS
277 Almost any piece of software will have bugs.  If you manage to find a
278 filesystem which causes 
279 .B e2fsck
280 to crash, or which 
281 .B e2fsck
282 is unable to repair, please report it to the author.
283 .PP
284 Please include as much information as possible in your bug report.
285 Ideally, include a complete transcript of the
286 .B e2fsck
287 run, so I can see exactly what error messages are displayed.  If you
288 have a writeable filesystem where the transcript can be stored, the 
289 .BR script (1)
290 program is a handy way to save the output of
291 .B e2fsck
292 to a file.
293 .PP
294 It is also useful to send the output of 
295 .BR dumpe2fs (8).
296 If a specific inode or inodes seems to be giving 
297 .B e2fsck 
298 trouble, try running the
299 .BR debugfs (8)
300 command and send the output of the 
301 .BR stat (1u)
302 command run on the relevant inode(s).  If the inode is a directory, the 
303 .B debugfs
304 .I dump
305 command will allow you to extract the contents of the directory inode,
306 which can sent to me after being first run through
307 .BR uuencode (1).
308 .PP
309 Always include the full version string which 
310 .B e2fsck
311 displays when it is run, so I know which version you are running.
312 .SH AUTHOR
313 This version of 
314 .B e2fsck
315 was written by Theodore Ts'o <tytso@mit.edu>.
316 .SH SEE ALSO
317 .BR mke2fs (8),
318 .BR tune2fs (8),
319 .BR dumpe2fs (8),
320 .BR debugfs (8)