1 .\" $NetBSD: fsck.8,v 1.19 1999/03/10 00:08:33 erh Exp $
3 .\" Copyright (c) 1996 Christos Zoulas. All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
13 .\" 3. All advertising materials mentioning features or use of this software
14 .\" must display the following acknowledgement:
15 .\" This product includes software developed by Christos Zoulas.
16 .\" 4. The name of the author may not be used to endorse or promote products
17 .\" derived from this software without specific prior written permission.
19 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 .Nd file system consistency check and interactive repair
40 .Op Fl T Ar fstype : Ns Ar fsoptions
43 .Oo Ar special | node Oc ...
47 utility invokes file system-specific programs to check
48 the special devices listed in the
50 file or in the command line for consistency.
52 It is normally used in the script
54 during automatic reboot.
57 is invoked before the file systems are mounted
58 and all checks are done to completion at that time.
59 If background checking is available,
62 It is first invoked at the traditional time,
63 before the file systems are mounted, with the
65 flag to do checking on all the file systems
66 that cannot do background checking.
67 It is then invoked a second time,
68 after the system has completed going multiuser, with the
70 flag to do checking on all the file systems
71 that can do background checking.
72 Unlike the foreground checking,
73 the background checking is started asynchronously
74 so that other system activity can proceed
75 even on the file systems that are being checked.
77 If no file systems are specified,
81 to determine which file systems to check.
89 and that have non-zero pass number are checked.
90 File systems with pass number 1 (normally just the root file system)
91 are always checked one at a time.
93 If not in preen mode, the remaining entries are checked in order of
94 increasing pass number one at a time.
95 This is needed when interaction with
99 In preen mode, after pass 1 completes, all remaining file systems are checked,
100 in pass number order running one process per disk drive in parallel for each
101 pass number in increasing order.
103 In other words: In preen mode all pass 1 partitions are checked sequentially.
104 Next all pass 2 partitions are checked in parallel, one process per disk drive.
105 Next all pass 3 partitions are checked in parallel, one process per disk drive.
108 The disk drive containing each file system is inferred from the shortest prefix
109 of the device name that ends in a digit; the remaining characters are assumed
110 to be the partition and slice designators.
116 flags are not specified,
118 will attempt to determine the file system type and call the
119 appropriate file system check utility.
120 Failure to detect the file system type will cause
122 to fail with a message that the partition has an unknown file system type.
124 The options are as follows:
125 .Bl -tag -width indent
129 flag is set in the superblock and skip file system checks if file system was
130 properly dismounted and marked clean.
137 Just print the commands without executing them.
141 is compiled to support it.
143 Force checking of file systems.
146 ignores the journal and does a full
147 consistency check of the disk so will find and fix the errors about which the
152 to assume no as the answer to all operator questions, except "CONTINUE?".
155 In preen mode, only a restricted class of innocuous
156 file system inconsistencies will be corrected.
157 If unexpected inconsistencies caused by hardware or
158 software failures are encountered, the check program
159 will exit with a failure.
160 See the manual pages for the individual check programs
161 for a list of the sorts of failures that they correct
162 when running in preen mode.
164 Run in foreground mode.
165 The check program for each file system is invoked with the
167 flag to determine whether it wishes to run as part of
168 the boot up sequence,
169 or if it is able to do its job in background after the
170 system is up and running.
171 A non-zero exit code indicates that it wants to run in foreground
172 and the check program is invoked.
173 A zero exit code indicates that it is able to run later in background
174 and just a deferred message is printed.
176 Run in background mode.
177 The check program for each file system is invoked with the
179 flag to determine whether it wishes to run as part of
180 the boot up sequence,
181 or if it is able to do its job in background after the
182 system is up and running.
183 A non-zero exit code indicates that it wanted to run in foreground
184 which is assumed to have been done, so the file system is skipped.
185 A zero exit code indicates that it is able to run in background
186 so the check program is invoked with the
188 flag to indicate that a check on the active file system should be done.
189 When running in background mode,
190 only one file system at a time will be checked.
193 is limited to checking for only the most commonly occurring
194 file system abnormalities.
195 Under certain circumstances,
196 some errors can escape background
198 It is recommended that you perform foreground
200 on your systems periodically and whenever you encounter
201 file-system\-related panics.
205 only for the comma separated list of file system types.
211 for the file system types that are not specified in the list.
213 Print the commands before executing them.
218 as the answer to all operator questions.
219 .It Fl T Ar fstype : Ns Ar fsoptions
220 List of comma separated file system specific options for the specified
221 file system type, in the same format as
225 .Bl -tag -width /etc/fstab -compact
239 It was reimplemented as a filesystem independent wrapper in
241 and first appeared in
243 The original filesystem specific utility became