]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sbin/fsck/fsck.8
This commit was generated by cvs2svn to compensate for changes in r133546,
[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 dvpfyn
40 .Op Fl B | F
41 .Op Fl t Ar fstype
42 .Op Fl T Ar fstype : Ns Ar fsoptions
43 .Op Ar special | node ...
44 .Sh DESCRIPTION
45 The
46 .Nm
47 utility invokes file system-specific programs to check
48 the special devices listed in the
49 .Xr fstab 5
50 file or in the command line for consistency.
51 .Pp
52 It is normally used in the script
53 .Pa /etc/rc
54 during automatic reboot.
55 Traditionally,
56 .Nm
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,
60 .Nm
61 is invoked twice.
62 It is first invoked at the traditional time,
63 before the file systems are mounted, with the
64 .Fl F
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
69 .Fl B
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.
76 .Pp
77 If no file systems are specified,
78 .Nm
79 reads the table
80 .Pa /etc/fstab
81 to determine which file systems to check.
82 Only partitions in
83 .Pa /etc/fstab
84 that are mounted
85 .Dq rw ,
86 .Dq rq
87 or
88 .Dq ro
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.
92 .Pp
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
96 .Nm
97 is required.
98 .Pp
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.
102 .Pp
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.
106 etc.
107 .Pp
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.
111 .Pp
112 The options are as follows:
113 .Bl -tag -width indent
114 .It Fl d
115 Debugging mode.
116 Just print the commands without executing them.
117 Available
118 only if
119 .Nm
120 is compiled to support it.
121 .It Fl f
122 Force checking of file systems, even when they are marked clean (for file systems
123 that support this).
124 .It Fl n
125 Causes
126 .Nm
127 to assume no as the answer to all operator questions, except "CONTINUE?".
128 .It Fl p
129 Enter preen mode.
130 In preen mode, only a restricted class of innocuous
131 file system inconsistencies will be corrected.
132 If unexpected inconsistencies caused by hardware or
133 software failures are encountered, the check program
134 will exit with a failure.
135 See the manual pages for the individual check programs
136 for a list of the sorts of failures that they correct
137 when running in preen mode.
138 .It Fl F
139 Run in foreground mode.
140 The check program for each file system is invoked with the
141 .Fl F
142 flag to determine whether it wishes to run as part of
143 the boot up sequence,
144 or if it is able to do its job in background after the
145 system is up and running.
146 A non-zero exit code indicates that it wants to run in foreground
147 and the check program is invoked.
148 A zero exit code indicates that it is able to run later in background
149 and just a deferred message is printed.
150 .It Fl B
151 Run in background mode.
152 The check program for each file system is invoked with the
153 .Fl F
154 flag to determine whether it wishes to run as part of
155 the boot up sequence,
156 or if it is able to do its job in background after the
157 system is up and running.
158 A non-zero exit code indicates that it wanted to run in foreground
159 which is assumed to have been done, so the file system is skipped.
160 A zero exit code indicates that it is able to run in background
161 so the check program is invoked with the
162 .Fl B
163 flag to indicate that a check on the active file system should be done.
164 When running in background mode,
165 only one file system at a time will be checked.
166 .It Fl t Ar fstype
167 Invoke
168 .Nm
169 only for the comma separated list of file system types.
170 If the
171 list starts with
172 .Dq no
173 then invoke
174 .Nm
175 for the file system types that are not specified in the list.
176 .It Fl v
177 Print the commands before executing them.
178 .It Fl y
179 Causes
180 .Nm
181 to assume yes
182 as the answer to all operator questions.
183 .It Fl T Ar fstype : Ns Ar fsoptions
184 List of comma separated file system specific options for the specified
185 file system type, in the same format as
186 .Xr mount 8 .
187 .El
188 .Sh FILES
189 .Bl -tag -width /etc/fstab -compact
190 .It Pa /etc/fstab
191 file system table
192 .El
193 .Sh SEE ALSO
194 .Xr fstab 5 ,
195 .Xr fsck_ffs 8 ,
196 .Xr fsck_msdosfs 8 ,
197 .Xr mount 8