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