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