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