Whamcloud - gitweb
Many files:
[tools/e2fsprogs.git] / misc / fsck.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 FSCK 8 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
6 .SH NAME
7 fsck \- check and repair a Linux file system
8 .SH SYNOPSIS
9 .B fsck
10 [
11 .B \-AVRTN
12 ]
13 [
14 .B \-s
15 ]
16 [
17 .B \-t
18 .I fstype
19 ]
20 [
21 .B fs-options
22 ]
23 .I filesys [ ... ]
24 .SH DESCRIPTION
25 .B fsck
26 is used to check and optionally repair a Linux file system.  
27 .I filesys
28 is either the device name (e.g. /dev/hda1, /dev/sdb2) or the mount point
29 (e.g. /, /usr, /home) for the file system.  If this fsck has several
30 filesystems on different physical disk drives to check, this fsck will
31 try to run them in parallel.  This reduces the total amount time it
32 takes to check all of the filesystems, since fsck takes advantage of the
33 parallelism of multiple disk spindles.
34 .PP
35 The exit code returned by
36 .B fsck
37 is the sum of the following conditions:
38 .br
39 \       0\      \-\ No errors
40 .br
41 \       1\      \-\ File system errors corrected
42 .br
43 \       2\      \-\ System should be rebooted
44 .br
45 \       4\      \-\ File system errors left uncorrected
46 .br
47 \       8\      \-\ Operational error
48 .br
49 \       16\     \-\ Usage or syntax error
50 .br
51 \       128\    \-\ Shared library error
52 .br
53 The exit code returned when all file systems are checked using the
54 .B -A
55 option is the bit-wise OR of the exit codes for each
56 file system that is checked.
57 .PP
58 In actuality,
59 .B fsck
60 is simply a front-end for the various file system checkers
61 (\fBfsck\fR.\fIfstype\fR) available under Linux.  The file
62 system-specific checker is searched for in /sbin first, then in /etc/fs
63 and /etc, and finally in the directories listed in the PATH environment
64 variable.  Please see the file system-specific checker manual pages for
65 further details.
66 .SH OPTIONS
67 .TP
68 .B -A
69 Walk through the
70 .I /etc/fstab
71 file and try to check all file systems in one run.  This option is
72 typically used from the
73 .I /etc/rc
74 system initalization file, instead of multiple commands for checking
75 a single file system.
76 .TP
77 .B -R
78 When checking all file systems with the
79 .B \-A
80 flag, skip the root file system (in case it's already mounted read-write).
81 .TP
82 .B -T
83 Don't show the title on startup.
84 .TP
85 .B -N
86 Don't execute, just show what would be done.
87 .TP
88 .B -s
89 Serialize fsck operations.  This is a good idea if you checking multiple
90 filesystems in and the checkers are in an interactive mode.  (Note:
91 .B e2fsck
92 runs in an interactive mode by default.  To make 
93 .B e2fsck
94 run in a non-interactive mode, you must either specify the
95 .B -p
96 or
97 .B -a
98 option, if you wish for errors to be corrected automatically, or
99 the 
100 .B -n
101 option if you do not.)
102 .TP
103 .B -V
104 Produce verbose output, including all file system-specific commands
105 that are executed.
106 .TP
107 .BI -t \ fstype
108 Specifies the type of file system to be checked.  When the
109 .B \-A 
110 flag is specified, only filesystems that match 
111 .I fstype
112 are checked.  If 
113 .I fstype
114 is prefixed with 
115 .B no
116 only filesystems whose filesystem do not match
117 .I fstype
118 are checked.
119 .sp
120 Normally, the filesystem type is deduced by searching for
121 .I filesys
122 in the 
123 .I /etc/fstab 
124 file and using the corresponding entry.
125 If the type can not be deduced, 
126 .B fsck
127 will use the type specified by the 
128 .B \-t
129 option if it specifies a unique filesystem type.  If this type is not
130 available, the the default file system type
131 (currently ext2) is used. 
132 .TP
133 .B fs-options
134 Any options which are not understood by 
135 .BR fsck ,
136 or which follow the
137 .B --
138 option are treated as file system-specific options to be passed to the
139 file system-specific checker.
140 .PP
141 Currently, standardized file system-specific options are somewhat in
142 flux.  Although not guaranteed, the following options are supported
143 by most file system checkers.
144 .TP
145 .B -a
146 Automatically repair the file system without any questions (use
147 this option with caution).  Note that 
148 .B e2fsck
149 supports 
150 .B -a
151 for backwards compatibility only.  This option is mapped to e2fsck's
152 .B -p
153 option which is safe to use, unlike the 
154 .B -a 
155 option that most file system checkers support.
156 .TP
157 .B -r
158 Interactively repair the filesystem (ask for confirmations).  Note: It
159 is generally a bad idea to use this option if multiple fsck's are being
160 run in parallel.  Also note that this is 
161 .B e2fsck
162 default behavior; it supports this option for backwards compatibility
163 reasons only.
164 .SH AUTHOR
165 Theodore Ts'o (tytso@mit.edu)
166 .PP
167 The manual page was shamelessly adapted from David Engel and Fred van
168 Kempen's generic fsck front end program, which was in turn shamelessly
169 adapted from Remy Card's version for the ext2 file system.
170 .SH FILES
171 .IR /etc/fstab .
172 .SH SEE ALSO
173 .BR fstab (5),
174 .BR mkfs (8),
175 .BR fsck.minix (8),
176 .BR fsck.ext2 (8)
177 or
178 .BR e2fsck (8),
179 .BR fsck.xiafs (8).