blob: c76ff036d09e4ecd751aa2a0da92a264af0ecc3a [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
Theodore Ts'o3b5386d2000-08-14 14:25:19 +000032is used to check a Linux second extended file system (e2fs). E2fsck also
33supports ext2 filesystems countaining a journal, which are
34also sometimes known as ext3 filesystems.
Theodore Ts'o3839e651997-04-26 13:21:57 +000035.TP
36.I device
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000037is the special file corresponding to the device (e.g
38.IR /dev/hdc1 ).
Theodore Ts'o3839e651997-04-26 13:21:57 +000039.SH OPTIONS
40.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000041.B \-a
Theodore Ts'of3db3561997-04-26 13:34:30 +000042This option does the same thing as the
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000043.B \-p
Theodore Ts'of3db3561997-04-26 13:34:30 +000044option. It is provided for backwards compatibility only; it is
45suggested that people use
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000046.B \-p
Theodore Ts'o583ccdc1997-05-09 03:06:31 +000047option whenever possible.
Theodore Ts'of3db3561997-04-26 13:34:30 +000048.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000049.BI \-b " superblock"
Theodore Ts'o24dd4021998-02-01 00:16:40 +000050Instead of using the normal superblock, use an alternative superblock
Theodore Ts'o3839e651997-04-26 13:21:57 +000051specified by
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000052.IR superblock .
53This option is normally used when the primary superblock has been
Theodore Ts'oa1ccadb1999-11-23 13:57:16 +000054corrupted. The location of the backup superblock is dependent on the
55filesystem's blocksize. For filesystems with 1k blocksizes, a backup
56superblock can be found at block 8193; for filesystems with 2k
57blocksizes, at block 16384; and for 4k blocksizes, at block 32768. If
58an alternative superblock is specified and
Theodore Ts'o24dd4021998-02-01 00:16:40 +000059the filesystem is not opened read-only, e2fsck will make sure that the
60primary superblock is updated appropriately upon completion of the
61filesystem check.
Theodore Ts'o3839e651997-04-26 13:21:57 +000062.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000063.BI \-B " blocksize"
Theodore Ts'o583ccdc1997-05-09 03:06:31 +000064Normally,
65.B e2fsck
66will search for the superblock at various different
67block sizes in an attempt to find the appropriate block size.
68This search can be fooled in some cases. This option forces
69.B e2fsck
70to only try locating the superblock at a particular blocksize.
71If the superblock is not found,
72.B e2fsck
73will terminate with a fatal error.
Theodore Ts'of3db3561997-04-26 13:34:30 +000074.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000075.B \-c
Theodore Ts'o583ccdc1997-05-09 03:06:31 +000076This option causes
77.B e2fsck
78to run the
Theodore Ts'o74becf31997-04-26 14:37:06 +000079.BR badblocks (8)
Theodore Ts'o583ccdc1997-05-09 03:06:31 +000080program to find any blocks which are bad on the filesystem,
81and then marks them as bad by adding them to the bad block inode.
Theodore Ts'o74becf31997-04-26 14:37:06 +000082.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000083.B \-C
Theodore Ts'oefac9a11998-05-07 05:02:00 +000084This option causes
85.B e2fsck
86to write completion information to the specified file descriptor
87so that the progress of the filesystem
Theodore Ts'o5596def1999-07-19 15:27:37 +000088check can be monitored. This option is typically used by programs
89which are running
90.BR e2fsck .
91If the file descriptor specified is 0,
Theodore Ts'oefac9a11998-05-07 05:02:00 +000092.B e2fsck
Theodore Ts'o5596def1999-07-19 15:27:37 +000093will print a completion bar as it goes about its business. This requires
94that e2fsck is running on a video console or terminal.
Theodore Ts'oefac9a11998-05-07 05:02:00 +000095.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000096.B \-d
Theodore Ts'o3839e651997-04-26 13:21:57 +000097Print debugging output (useless unless you are debugging
Theodore Ts'o583ccdc1997-05-09 03:06:31 +000098.BR e2fsck ).
Theodore Ts'o3839e651997-04-26 13:21:57 +000099.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000100.B \-f
Theodore Ts'o3839e651997-04-26 13:21:57 +0000101Force checking even if the file system seems clean.
102.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000103.B \-F
Theodore Ts'o3839e651997-04-26 13:21:57 +0000104Flush the filesystem device's buffer caches before beginning. Only
Theodore Ts'o583ccdc1997-05-09 03:06:31 +0000105really useful for doing
106.B e2fsck
107time trials.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000108.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000109.BI \-l " filename"
Theodore Ts'o3839e651997-04-26 13:21:57 +0000110Add the blocks listed in the file specified by
111.I filename
Theodore Ts'o43139321998-02-16 22:34:46 +0000112to the list of bad blocks. The format of this file is the same as the
113one generated by the
114.BR badblocks (8)
115program.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000116.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000117.BI \-L " filename"
Theodore Ts'o3839e651997-04-26 13:21:57 +0000118Set the bad blocks list to be the list of blocks specified by
119.IR filename .
120(This option is the same as the
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000121.B \-l
Theodore Ts'o3839e651997-04-26 13:21:57 +0000122option, except the bad blocks list is cleared before the blocks listed
123in the file are added to the bad blocks list.)
124.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000125.B \-n
126Open the filesystem read-only, and assume an answer of `no' to all
Theodore Ts'o3839e651997-04-26 13:21:57 +0000127questions. Allows
128.B e2fsck
129to be used non-interactively. (Note: if the
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000130.BR \-c ,
131.BR \-l ,
Theodore Ts'o3839e651997-04-26 13:21:57 +0000132or
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000133.B \-L
Theodore Ts'o3839e651997-04-26 13:21:57 +0000134options are specified in addition to the
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000135.B \-n
Theodore Ts'o3839e651997-04-26 13:21:57 +0000136option, then the filesystem will be opened read-write, to permit the
137bad-blocks list to be updated. However, no other changes will be made
138to the filesystem.)
139.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000140.B \-p
Theodore Ts'o3839e651997-04-26 13:21:57 +0000141Automatically repair ("preen") the file system without any questions.
Theodore Ts'of3db3561997-04-26 13:34:30 +0000142.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000143.B \-r
Theodore Ts'of3db3561997-04-26 13:34:30 +0000144This option does nothing at all; it is provided only for backwards
145compatibility.
Theodore Ts'o583ccdc1997-05-09 03:06:31 +0000146.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000147.B \-s
Theodore Ts'o1e3472c1997-04-29 14:53:37 +0000148This option will byte-swap the filesystem so that it is using the normalized,
149standard byte-order (which is i386 or little endian). If the filesystem is
Theodore Ts'o583ccdc1997-05-09 03:06:31 +0000150already in the standard byte-order,
151.B e2fsck
152will take no action.
Theodore Ts'o1e3472c1997-04-29 14:53:37 +0000153.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000154.B \-S
Theodore Ts'o1e3472c1997-04-29 14:53:37 +0000155This option will byte-swap the filesystem, regardless of its current
156byte-order.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000157.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000158.B \-t
Theodore Ts'o3839e651997-04-26 13:21:57 +0000159Print timing statistics for
160.BR e2fsck .
161If this option is used twice, additional timing statistics are printed
162on a pass by pass basis.
163.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000164.B \-v
Theodore Ts'o3839e651997-04-26 13:21:57 +0000165Verbose mode.
166.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000167.B \-V
Theodore Ts'o3839e651997-04-26 13:21:57 +0000168Print version information and exit.
169.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000170.B \-y
171Assume an answer of `yes' to all questions; allows
Theodore Ts'o3839e651997-04-26 13:21:57 +0000172.B e2fsck
173to be used non-interactively.
174.SH EXIT CODE
175The exit code returned by
176.B e2fsck
177is the sum of the following conditions:
178.br
179\ 0\ \-\ No errors
180.br
181\ 1\ \-\ File system errors corrected
182.br
183\ 2\ \-\ File system errors corrected, system should
184.br
185\ \ \ \ be rebooted if file system was mounted
186.br
187\ 4\ \-\ File system errors left uncorrected
188.br
189\ 8\ \-\ Operational error
190.br
191\ 16\ \-\ Usage or syntax error
192.br
193\ 128\ \-\ Shared library error
194.br
Theodore Ts'o5596def1999-07-19 15:27:37 +0000195.SH SIGNALS
196The following signals have the following effect when sent to
197.BR e2fsck .
198.TP
199.B SIGUSR1
200This signal causes
201.B e2fsck
202to start displaying a completion bar. (See discussion of the
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +0000203.B \-C
Theodore Ts'o5596def1999-07-19 15:27:37 +0000204option.)
205.TP
206.B SIGUSR2
207This signal causes
208.B e2fsck
209to stop displaying a completion bar.
Theodore Ts'o5c576471997-04-29 15:29:49 +0000210.SH REPORTING BUGS
Theodore Ts'of3db3561997-04-26 13:34:30 +0000211Almost any piece of software will have bugs. If you manage to find a
212filesystem which causes
213.B e2fsck
214to crash, or which
215.B e2fsck
216is unable to repair, please report it to the author.
217.PP
218Please include as much information as possible in your bug report.
219Ideally, include a complete transcript of the
220.B e2fsck
221run, so I can see exactly what error messages are displayed. If you
222have a writeable filesystem where the transcript can be stored, the
223.BR script (1)
224program is a handy way to save the output of
Theodore Ts'o583ccdc1997-05-09 03:06:31 +0000225.B e2fsck
Theodore Ts'of3db3561997-04-26 13:34:30 +0000226to a file.
227.PP
228It is also useful to send the output of
229.BR dumpe2fs (8).
230If a specific inode or inodes seems to be giving
231.B e2fsck
232trouble, try running the
233.BR debugfs (8)
234command and send the output of the
Theodore Ts'o583ccdc1997-05-09 03:06:31 +0000235.BR stat (1u)
236command run on the relevant inode(s). If the inode is a directory, the
237.B debugfs
Theodore Ts'of3db3561997-04-26 13:34:30 +0000238.I dump
239command will allow you to extract the contents of the directory inode,
240which can sent to me after being first run through
241.BR uuencode (1).
242.PP
243Always include the full version string which
244.B e2fsck
245displays when it is run, so I know which version you are running.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000246.SH AUTHOR
247This version of
248.B e2fsck
Theodore Ts'o583ccdc1997-05-09 03:06:31 +0000249was written by Theodore Ts'o <tytso@mit.edu>.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000250.SH SEE ALSO
251.BR mke2fs (8),
Theodore Ts'of3db3561997-04-26 13:34:30 +0000252.BR tune2fs (8),
253.BR dumpe2fs (8),
254.BR debugfs (8)