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