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