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