blob: a72194ac9055ccdb015bec67f1586c865d3e7c3e [file] [log] [blame]
Theodore Ts'o3839e651997-04-26 13:21:57 +00001.\" -*- nroff -*-
Theodore Ts'o50e1e101997-04-26 13:58:21 +00002.\" Copyright 1993, 1994, 1995 by Theodore Ts'o. All Rights Reserved.
Theodore Ts'o3839e651997-04-26 13:21:57 +00003.\" This file may be copied under the terms of the GNU Public License.
4.\"
Theodore Ts'o74becf31997-04-26 14:37:06 +00005.TH E2FSCK 8 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
Theodore Ts'o3839e651997-04-26 13:21:57 +00006.SH NAME
7e2fsck \- check a Linux second extended file system
8.SH SYNOPSIS
9.B e2fsck
10[
Theodore Ts'o1e3472c1997-04-29 14:53:37 +000011.B \-pacnyrdfvstFSV
Theodore Ts'o3839e651997-04-26 13:21:57 +000012]
13[
14.B \-b
15.I superblock
16]
17[
18.B \-B
19.I blocksize
20]
21[
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000022.BR \-l | \-L
Theodore Ts'o3839e651997-04-26 13:21:57 +000023.I bad_blocks_file
24]
Theodore Ts'oefac9a11998-05-07 05:02:00 +000025[
26.B \-C
27.I fd
28]
Theodore Ts'o3839e651997-04-26 13:21:57 +000029.I device
30.SH DESCRIPTION
31.B e2fsck
32is used to check a Linux second extended file system.
33.TP
34.I device
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000035is the special file corresponding to the device (e.g
36.IR /dev/hdc1 ).
Theodore Ts'o3839e651997-04-26 13:21:57 +000037.SH OPTIONS
38.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000039.B \-a
Theodore Ts'of3db3561997-04-26 13:34:30 +000040This option does the same thing as the
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000041.B \-p
Theodore Ts'of3db3561997-04-26 13:34:30 +000042option. It is provided for backwards compatibility only; it is
43suggested that people use
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000044.B \-p
Theodore Ts'o583ccdc1997-05-09 03:06:31 +000045option whenever possible.
Theodore Ts'of3db3561997-04-26 13:34:30 +000046.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000047.BI \-b " superblock"
Theodore Ts'o24dd4021998-02-01 00:16:40 +000048Instead of using the normal superblock, use an alternative superblock
Theodore Ts'o3839e651997-04-26 13:21:57 +000049specified by
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000050.IR superblock .
51This option is normally used when the primary superblock has been
Theodore Ts'oa1ccadb1999-11-23 13:57:16 +000052corrupted. The location of the backup superblock is dependent on the
53filesystem's blocksize. For filesystems with 1k blocksizes, a backup
54superblock can be found at block 8193; for filesystems with 2k
55blocksizes, at block 16384; and for 4k blocksizes, at block 32768. If
56an alternative superblock is specified and
Theodore Ts'o24dd4021998-02-01 00:16:40 +000057the filesystem is not opened read-only, e2fsck will make sure that the
58primary superblock is updated appropriately upon completion of the
59filesystem check.
Theodore Ts'o3839e651997-04-26 13:21:57 +000060.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000061.BI \-B " blocksize"
Theodore Ts'o583ccdc1997-05-09 03:06:31 +000062Normally,
63.B e2fsck
64will search for the superblock at various different
65block sizes in an attempt to find the appropriate block size.
66This search can be fooled in some cases. This option forces
67.B e2fsck
68to only try locating the superblock at a particular blocksize.
69If the superblock is not found,
70.B e2fsck
71will terminate with a fatal error.
Theodore Ts'of3db3561997-04-26 13:34:30 +000072.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000073.B \-c
Theodore Ts'o583ccdc1997-05-09 03:06:31 +000074This option causes
75.B e2fsck
76to run the
Theodore Ts'o74becf31997-04-26 14:37:06 +000077.BR badblocks (8)
Theodore Ts'o583ccdc1997-05-09 03:06:31 +000078program to find any blocks which are bad on the filesystem,
79and then marks them as bad by adding them to the bad block inode.
Theodore Ts'o74becf31997-04-26 14:37:06 +000080.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000081.B \-C
Theodore Ts'oefac9a11998-05-07 05:02:00 +000082This option causes
83.B e2fsck
84to write completion information to the specified file descriptor
85so that the progress of the filesystem
Theodore Ts'o5596def1999-07-19 15:27:37 +000086check can be monitored. This option is typically used by programs
87which are running
88.BR e2fsck .
89If the file descriptor specified is 0,
Theodore Ts'oefac9a11998-05-07 05:02:00 +000090.B e2fsck
Theodore Ts'o5596def1999-07-19 15:27:37 +000091will print a completion bar as it goes about its business. This requires
92that e2fsck is running on a video console or terminal.
Theodore Ts'oefac9a11998-05-07 05:02:00 +000093.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000094.B \-d
Theodore Ts'o3839e651997-04-26 13:21:57 +000095Print debugging output (useless unless you are debugging
Theodore Ts'o583ccdc1997-05-09 03:06:31 +000096.BR e2fsck ).
Theodore Ts'o3839e651997-04-26 13:21:57 +000097.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000098.B \-f
Theodore Ts'o3839e651997-04-26 13:21:57 +000099Force checking even if the file system seems clean.
100.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000101.B \-F
Theodore Ts'o3839e651997-04-26 13:21:57 +0000102Flush the filesystem device's buffer caches before beginning. Only
Theodore Ts'o583ccdc1997-05-09 03:06:31 +0000103really useful for doing
104.B e2fsck
105time trials.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000106.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000107.BI \-l " filename"
Theodore Ts'o3839e651997-04-26 13:21:57 +0000108Add the blocks listed in the file specified by
109.I filename
Theodore Ts'o43139321998-02-16 22:34:46 +0000110to the list of bad blocks. The format of this file is the same as the
111one generated by the
112.BR badblocks (8)
113program.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000114.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000115.BI \-L " filename"
Theodore Ts'o3839e651997-04-26 13:21:57 +0000116Set the bad blocks list to be the list of blocks specified by
117.IR filename .
118(This option is the same as the
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000119.B \-l
Theodore Ts'o3839e651997-04-26 13:21:57 +0000120option, except the bad blocks list is cleared before the blocks listed
121in the file are added to the bad blocks list.)
122.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000123.B \-n
124Open the filesystem read-only, and assume an answer of `no' to all
Theodore Ts'o3839e651997-04-26 13:21:57 +0000125questions. Allows
126.B e2fsck
127to be used non-interactively. (Note: if the
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000128.BR \-c ,
129.BR \-l ,
Theodore Ts'o3839e651997-04-26 13:21:57 +0000130or
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000131.B \-L
Theodore Ts'o3839e651997-04-26 13:21:57 +0000132options are specified in addition to the
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000133.B \-n
Theodore Ts'o3839e651997-04-26 13:21:57 +0000134option, then the filesystem will be opened read-write, to permit the
135bad-blocks list to be updated. However, no other changes will be made
136to the filesystem.)
137.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000138.B \-p
Theodore Ts'o3839e651997-04-26 13:21:57 +0000139Automatically repair ("preen") the file system without any questions.
Theodore Ts'of3db3561997-04-26 13:34:30 +0000140.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000141.B \-r
Theodore Ts'of3db3561997-04-26 13:34:30 +0000142This option does nothing at all; it is provided only for backwards
143compatibility.
Theodore Ts'o583ccdc1997-05-09 03:06:31 +0000144.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000145.B \-s
Theodore Ts'o1e3472c1997-04-29 14:53:37 +0000146This option will byte-swap the filesystem so that it is using the normalized,
147standard byte-order (which is i386 or little endian). If the filesystem is
Theodore Ts'o583ccdc1997-05-09 03:06:31 +0000148already in the standard byte-order,
149.B e2fsck
150will take no action.
Theodore Ts'o1e3472c1997-04-29 14:53:37 +0000151.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000152.B \-S
Theodore Ts'o1e3472c1997-04-29 14:53:37 +0000153This option will byte-swap the filesystem, regardless of its current
154byte-order.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000155.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000156.B \-t
Theodore Ts'o3839e651997-04-26 13:21:57 +0000157Print timing statistics for
158.BR e2fsck .
159If this option is used twice, additional timing statistics are printed
160on a pass by pass basis.
161.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000162.B \-v
Theodore Ts'o3839e651997-04-26 13:21:57 +0000163Verbose mode.
164.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000165.B \-V
Theodore Ts'o3839e651997-04-26 13:21:57 +0000166Print version information and exit.
167.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000168.B \-y
169Assume an answer of `yes' to all questions; allows
Theodore Ts'o3839e651997-04-26 13:21:57 +0000170.B e2fsck
171to be used non-interactively.
172.SH EXIT CODE
173The exit code returned by
174.B e2fsck
175is 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
Theodore Ts'o5596def1999-07-19 15:27:37 +0000193.SH SIGNALS
194The following signals have the following effect when sent to
195.BR e2fsck .
196.TP
197.B SIGUSR1
198This signal causes
199.B e2fsck
200to start displaying a completion bar. (See discussion of the
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000201.B \-C
Theodore Ts'o5596def1999-07-19 15:27:37 +0000202option.)
203.TP
204.B SIGUSR2
205This signal causes
206.B e2fsck
207to stop displaying a completion bar.
Theodore Ts'o5c576471997-04-29 15:29:49 +0000208.SH REPORTING BUGS
Theodore Ts'of3db3561997-04-26 13:34:30 +0000209Almost any piece of software will have bugs. If you manage to find a
210filesystem which causes
211.B e2fsck
212to crash, or which
213.B e2fsck
214is unable to repair, please report it to the author.
215.PP
216Please include as much information as possible in your bug report.
217Ideally, include a complete transcript of the
218.B e2fsck
219run, so I can see exactly what error messages are displayed. If you
220have a writeable filesystem where the transcript can be stored, the
221.BR script (1)
222program is a handy way to save the output of
Theodore Ts'o583ccdc1997-05-09 03:06:31 +0000223.B e2fsck
Theodore Ts'of3db3561997-04-26 13:34:30 +0000224to a file.
225.PP
226It is also useful to send the output of
227.BR dumpe2fs (8).
228If a specific inode or inodes seems to be giving
229.B e2fsck
230trouble, try running the
231.BR debugfs (8)
232command and send the output of the
Theodore Ts'o583ccdc1997-05-09 03:06:31 +0000233.BR stat (1u)
234command run on the relevant inode(s). If the inode is a directory, the
235.B debugfs
Theodore Ts'of3db3561997-04-26 13:34:30 +0000236.I dump
237command will allow you to extract the contents of the directory inode,
238which can sent to me after being first run through
239.BR uuencode (1).
240.PP
241Always include the full version string which
242.B e2fsck
243displays when it is run, so I know which version you are running.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000244.SH AUTHOR
245This version of
246.B e2fsck
Theodore Ts'o583ccdc1997-05-09 03:06:31 +0000247was written by Theodore Ts'o <tytso@mit.edu>.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000248.SH SEE ALSO
249.BR mke2fs (8),
Theodore Ts'of3db3561997-04-26 13:34:30 +0000250.BR tune2fs (8),
251.BR dumpe2fs (8),
252.BR debugfs (8)