Whamcloud - gitweb
ChangeLog, e2fsck.8.in, unix.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.
89 .TP
90 .I -L filename
91 Set the bad blocks list to be the list of blocks specified by 
92 .IR filename .
93 (This option is the same as the 
94 .I -l
95 option, except the bad blocks list is cleared before the blocks listed
96 in the file are added to the bad blocks list.)
97 .TP
98 .I -n
99 Open the filesystem read-only, and assume an answer of ``no'' to all
100 questions.  Allows
101 .B e2fsck
102 to be used non-interactively.  (Note: if the 
103 .IR -c ,
104 .IR -l ,
105 or
106 .I -L
107 options are specified in addition to the 
108 .I -n
109 option, then the filesystem will be opened read-write, to permit the
110 bad-blocks list to be updated.  However, no other changes will be made
111 to the filesystem.)
112 .TP
113 .I -p
114 Automatically repair ("preen") the file system without any questions.
115 .TP
116 .I -r
117 This option does nothing at all; it is provided only for backwards
118 compatibility.
119 .TP 
120 .I -s
121 This option will byte-swap the filesystem so that it is using the normalized, 
122 standard byte-order (which is i386 or little endian).  If the filesystem is
123 already in the standard byte-order, 
124 .B e2fsck 
125 will take no action.
126 .TP
127 .I -S
128 This option will byte-swap the filesystem, regardless of its current 
129 byte-order.
130 .TP
131 .I -t
132 Print timing statistics for
133 .BR e2fsck .
134 If this option is used twice, additional timing statistics are printed
135 on a pass by pass basis.
136 .TP
137 .I -v
138 Verbose mode.
139 .TP
140 .I -V
141 Print version information and exit.
142 .TP
143 .I -y
144 Assume an answer of ``yes'' to all questions; allows 
145 .B e2fsck
146 to be used non-interactively.
147 .SH EXIT CODE
148 The exit code returned by
149 .B e2fsck
150 is the sum of the following conditions:
151 .br
152 \       0\      \-\ No errors
153 .br
154 \       1\      \-\ File system errors corrected
155 .br
156 \       2\      \-\ File system errors corrected, system should
157 .br
158 \       \       \ \ be rebooted if file system was mounted
159 .br
160 \       4\      \-\ File system errors left uncorrected
161 .br
162 \       8\      \-\ Operational error
163 .br
164 \       16\     \-\ Usage or syntax error
165 .br
166 \       128\    \-\ Shared library error
167 .br
168 .SH REPORTING BUGS
169 Almost any piece of software will have bugs.  If you manage to find a
170 filesystem which causes 
171 .B e2fsck
172 to crash, or which 
173 .B e2fsck
174 is unable to repair, please report it to the author.
175 .PP
176 Please include as much information as possible in your bug report.
177 Ideally, include a complete transcript of the
178 .B e2fsck
179 run, so I can see exactly what error messages are displayed.  If you
180 have a writeable filesystem where the transcript can be stored, the 
181 .BR script (1)
182 program is a handy way to save the output of
183 .B e2fsck
184 to a file.
185 .PP
186 It is also useful to send the output of 
187 .BR dumpe2fs (8).
188 If a specific inode or inodes seems to be giving 
189 .B e2fsck 
190 trouble, try running the
191 .BR debugfs (8)
192 command and send the output of the 
193 .BR stat (1u)
194 command run on the relevant inode(s).  If the inode is a directory, the 
195 .B debugfs
196 .I dump
197 command will allow you to extract the contents of the directory inode,
198 which can sent to me after being first run through
199 .BR uuencode (1).
200 .PP
201 Always include the full version string which 
202 .B e2fsck
203 displays when it is run, so I know which version you are running.
204 .SH AUTHOR
205 This version of 
206 .B e2fsck
207 was written by Theodore Ts'o <tytso@mit.edu>.
208 .SH SEE ALSO
209 .BR mke2fs (8),
210 .BR tune2fs (8),
211 .BR dumpe2fs (8),
212 .BR debugfs (8)