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