]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sbin/fsck/fsck.8
This commit was generated by cvs2svn to compensate for changes in r94670,
[FreeBSD/FreeBSD.git] / sbin / fsck / fsck.8
1 .\"     $NetBSD: fsck.8,v 1.19 1999/03/10 00:08:33 erh Exp $
2 .\"     $FreeBSD$
3 .\"
4 .\" Copyright (c) 1996 Christos Zoulas.  All rights reserved.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\"    notice, this list of conditions and the following disclaimer in the
13 .\"    documentation and/or other materials provided with the distribution.
14 .\" 3. All advertising materials mentioning features or use of this software
15 .\"    must display the following acknowledgement:
16 .\"     This product includes software developed by Christos Zoulas.
17 .\" 4. The name of the author may not be used to endorse or promote products
18 .\"    derived from this software without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 .\"
31 .Dd April 25, 2001
32 .Dt FSCK 8
33 .Os
34 .Sh NAME
35 .Nm fsck
36 .Nd file system consistency check and interactive repair
37 .Sh SYNOPSIS
38 .Nm
39 .Op Fl dvplfyn
40 .Op Fl B | F
41 .Op Fl l Ar maxparallel
42 .Op Fl t Ar fstype
43 .Op Fl T Ar fstype : Ns Ar fsoptions
44 .Op Ar special | node ...
45 .Sh DESCRIPTION
46 The
47 .Nm
48 command invokes filesystem-specific programs to check
49 the special devices listed in the
50 .Xr fstab 5
51 file or in the command line for consistency.
52 .Pp
53 It is normally used in the script
54 .Pa /etc/rc
55 during automatic reboot.
56 Traditionally,
57 .Nm
58 is invoked before the filesystems are mounted
59 and all checks are done to completion at that time.
60 If background checking is available,
61 .Nm
62 is invoked twice.
63 It is first invoked at the traditional time,
64 before the filesystems are mounted, with the
65 .Fl F
66 flag to do checking on all the filesystems
67 that cannot do background checking.
68 It is then invoked a second time,
69 after the system has completed going multiuser, with the
70 .Fl B
71 flag to do checking on all the filesystems
72 that can do background checking.
73 Unlike the foreground checking,
74 the background checking is started asynchonously
75 so that other system activity can proceed
76 even on the filesystems that are being checked.
77 .Pp
78 If no filesystems are specified,
79 .Nm
80 reads the table
81 .Pa /etc/fstab
82 to determine which filesystems to check.
83 Only partitions in
84 .Pa /etc/fstab
85 that are mounted
86 .Dq rw ,
87 .Dq rq
88 or
89 .Dq ro
90 and that have non-zero pass number are checked.
91 Filesystems with pass number 1 (normally just the root filesystem)
92 are always checked one at a time.
93 .Pp
94 If not in preen mode, the remaining entries are checked in order of
95 increasing pass number one at a time.
96 This is needed when interaction with
97 .Nm
98 is required.
99 .Pp
100 In preen mode, after pass 1 completes, all remaining filesystems are checked,
101 in pass number order running one process per disk drive in parallel for each
102 pass number in increasing order.
103 .Pp
104 In other words:  In preen mode all pass 1 partitions are checked sequentially.
105 Next all pass 2 partitions are checked in parallel, one process per disk drive.
106 Next all pass 3 partitions are checked in parallel, one process per disk drive.
107 etc.
108 .Pp
109 The disk drive containing each filesystem is inferred from the shortest prefix
110 of the device name that ends in a digit; the remaining characters are assumed
111 to be the partition and slice designators.
112 .Pp
113 The options are as follows:
114 .Bl -tag -width indent
115 .It Fl d
116 Debugging mode. Just print the commands without executing them. Available
117 only if
118 .Nm
119 is compiled to support it.
120 .It Fl f
121 Force checking of filesystems, even when they are marked clean (for filesystems
122 that support this).
123 .It Fl n
124 Causes
125 .Nm
126 to assume no as the answer to all operator questions, except "CONTINUE?".
127 .It Fl p
128 Enter preen mode.
129 In preen mode, only a restricted class of innocuous
130 filesystem inconsistencies will be corrected.
131 If unexpected inconsistencies caused by hardware or
132 software failures are encounted, the check program
133 will exit with a failure.
134 See the manual pages for the individual check programs
135 for a list of the sorts of failures that they correct
136 when running in preen mode.
137 .It Fl F
138 Run in foreground mode.
139 The check program for each filesystem is invoked with the
140 .Fl F
141 flag to determine whether it wishes to run as part of
142 the boot up sequence,
143 or if it is able to do its job in background after the
144 system is up and running.
145 A non-zero exit code indicates that it wants to run in foreground
146 and the check program is invoked.
147 A zero exit code indicates that it is able to run later in background
148 and just a deferred message is printed.
149 .It Fl B
150 Run in background mode.
151 The check program for each filesystem is invoked with the
152 .Fl F
153 flag to determine whether it wishes to run as part of
154 the boot up sequence,
155 or if it is able to do its job in background after the
156 system is up and running.
157 A non-zero exit code indicates that it wanted to run in foreground
158 which is assumed to have been done, so the filesystem is skipped.
159 A zero exit code indicates that it is able to run in background
160 so the check program is invoked with the
161 .Fl B
162 flag to indicate that a check on the active filesystem should be done.
163 When running in background mode,
164 only one filesystem at a time will be checked.
165 .It Fl t Ar fstype
166 Invoke
167 .Nm
168 only for the comma separated list of filesystem types. If the
169 list starts with
170 .Dq no
171 then invoke
172 .Nm
173 for the filesystem types that are not specified in the list.
174 .It Fl v
175 Print the commands before executing them.
176 .It Fl y
177 Causes
178 .Nm
179 to assume yes
180 as the answer to all operator questions.
181 .It Fl T Ar fstype : Ns Ar fsoptions
182 List of comma separated file system specific options for the specified
183 file system type, in the same format as
184 .Xr mount 8 .
185 .El
186 .Sh FILES
187 .Bl -tag -width /etc/fstab -compact
188 .It Pa /etc/fstab
189 file system table
190 .El
191 .Sh SEE ALSO
192 .Xr fstab 5 ,
193 .Xr fsck_ffs 8 ,
194 .Xr fsck_msdosfs 8 ,
195 .Xr mount 8