xref: /minix3/sbin/fsck/fsck.8 (revision 4d4057d8a2cac606f1af23617ce97ebf520ebc73)
1*4d4057d8SBen Gras.\"	$NetBSD: fsck.8,v 1.38 2011/04/28 12:16:10 wiz Exp $
2*4d4057d8SBen Gras.\"
3*4d4057d8SBen Gras.\" Copyright (c) 1996 Christos Zoulas.  All rights reserved.
4*4d4057d8SBen Gras.\"
5*4d4057d8SBen Gras.\" Redistribution and use in source and binary forms, with or without
6*4d4057d8SBen Gras.\" modification, are permitted provided that the following conditions
7*4d4057d8SBen Gras.\" are met:
8*4d4057d8SBen Gras.\" 1. Redistributions of source code must retain the above copyright
9*4d4057d8SBen Gras.\"    notice, this list of conditions and the following disclaimer.
10*4d4057d8SBen Gras.\" 2. Redistributions in binary form must reproduce the above copyright
11*4d4057d8SBen Gras.\"    notice, this list of conditions and the following disclaimer in the
12*4d4057d8SBen Gras.\"    documentation and/or other materials provided with the distribution.
13*4d4057d8SBen Gras.\"
14*4d4057d8SBen Gras.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15*4d4057d8SBen Gras.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16*4d4057d8SBen Gras.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17*4d4057d8SBen Gras.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18*4d4057d8SBen Gras.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19*4d4057d8SBen Gras.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20*4d4057d8SBen Gras.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21*4d4057d8SBen Gras.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22*4d4057d8SBen Gras.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23*4d4057d8SBen Gras.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24*4d4057d8SBen Gras.\"
25*4d4057d8SBen Gras.Dd February 17, 2010
26*4d4057d8SBen Gras.Dt FSCK 8
27*4d4057d8SBen Gras.Os
28*4d4057d8SBen Gras.Sh NAME
29*4d4057d8SBen Gras.Nm fsck
30*4d4057d8SBen Gras.Nd file system consistency check and interactive repair
31*4d4057d8SBen Gras.Sh SYNOPSIS
32*4d4057d8SBen Gras.Nm
33*4d4057d8SBen Gras.Op Fl dfnPpqvy
34*4d4057d8SBen Gras.Op Fl l Ar maxparallel
35*4d4057d8SBen Gras.Op Fl T Ar fstype:fsoptions
36*4d4057d8SBen Gras.Op Fl t Ar fstype
37*4d4057d8SBen Gras.Op Fl x Ar mountpoint
38*4d4057d8SBen Gras.Op special | node ...
39*4d4057d8SBen Gras.Sh DESCRIPTION
40*4d4057d8SBen GrasThe
41*4d4057d8SBen Gras.Nm
42*4d4057d8SBen Grascommand invokes file system-specific programs to check
43*4d4057d8SBen Grasthe special devices listed in the
44*4d4057d8SBen Gras.Xr fstab 5
45*4d4057d8SBen Grasfile or in the command line for consistency.
46*4d4057d8SBen Gras.Pp
47*4d4057d8SBen GrasIt is normally used in the script
48*4d4057d8SBen Gras.Pa /etc/rc
49*4d4057d8SBen Grasduring automatic reboot.
50*4d4057d8SBen GrasIf no file systems are specified, and
51*4d4057d8SBen Gras.Dq preen
52*4d4057d8SBen Grasmode is enabled (
53*4d4057d8SBen Gras.Fl p
54*4d4057d8SBen Grasoption)
55*4d4057d8SBen Gras.Nm
56*4d4057d8SBen Grasreads the table
57*4d4057d8SBen Gras.Pa /etc/fstab
58*4d4057d8SBen Grasto determine which file systems to check, in what order.
59*4d4057d8SBen GrasOnly partitions in fstab that are mounted ``rw,'' ``rq'' or ``ro''
60*4d4057d8SBen Grasand that have non-zero pass number are checked.
61*4d4057d8SBen GrasFile systems with pass number 1 (normally just the root file system)
62*4d4057d8SBen Grasare checked one at a time.
63*4d4057d8SBen GrasWhen pass 1 completes, all remaining file systems are checked,
64*4d4057d8SBen Grasrunning one process per disk drive.
65*4d4057d8SBen GrasBy default, file systems which are already mounted read-write are not checked.
66*4d4057d8SBen GrasThe disk drive containing each file system is inferred from the longest prefix
67*4d4057d8SBen Grasof the device name that ends in a digit; the remaining characters are assumed
68*4d4057d8SBen Grasto be the partition designator.
69*4d4057d8SBen Gras.Pp
70*4d4057d8SBen GrasThe options are as follows:
71*4d4057d8SBen Gras.Bl -tag -width indent
72*4d4057d8SBen Gras.It Fl d
73*4d4057d8SBen GrasDebugging mode.
74*4d4057d8SBen GrasJust print the commands without executing them.
75*4d4057d8SBen Gras.It Fl f
76*4d4057d8SBen GrasForce checking of file systems, even when they are marked clean (for file
77*4d4057d8SBen Grassystems that support this), or when they are mounted read-write.
78*4d4057d8SBen Gras.It Fl l Ar maxparallel
79*4d4057d8SBen GrasLimit the number of parallel checks to the number specified in
80*4d4057d8SBen Grasthe following argument.
81*4d4057d8SBen GrasBy default, the limit is the number of disks, running one process per disk.
82*4d4057d8SBen GrasIf a smaller limit is given, the disks are checked round-robin,
83*4d4057d8SBen Grasone file system at a time.
84*4d4057d8SBen Gras.It Fl n
85*4d4057d8SBen GrasCauses
86*4d4057d8SBen Gras.Nm
87*4d4057d8SBen Grasto assume no as the answer to all operator questions, except "CONTINUE?".
88*4d4057d8SBen Gras.It Fl P
89*4d4057d8SBen GrasDisplay a progress meter for each file system check.
90*4d4057d8SBen GrasThis option also disables parallel checking.
91*4d4057d8SBen GrasNote that progress meters are not supported by all file system types.
92*4d4057d8SBen Gras.It Fl p
93*4d4057d8SBen GrasEnter preen mode.
94*4d4057d8SBen GrasIn preen mode,
95*4d4057d8SBen Gras.Nm
96*4d4057d8SBen Graswill check all file systems listed in
97*4d4057d8SBen Gras.Pa /etc/fstab
98*4d4057d8SBen Grasaccording to their pass number, and will make minor repairs without
99*4d4057d8SBen Grashuman intervention.
100*4d4057d8SBen Gras.It Fl q
101*4d4057d8SBen GrasQuiet mode, do not output any messages for clean filesystems.
102*4d4057d8SBen Gras.It Fl T Ar fstype:fsoptions
103*4d4057d8SBen GrasList of comma separated file system specific options for the specified
104*4d4057d8SBen Grasfile system type, in the same format as
105*4d4057d8SBen Gras.Xr mount 8 .
106*4d4057d8SBen Gras.It Fl t Ar fstype
107*4d4057d8SBen GrasInvoke
108*4d4057d8SBen Gras.Nm
109*4d4057d8SBen Grasonly for the comma separated list of file system types.
110*4d4057d8SBen GrasIf the list starts with
111*4d4057d8SBen Gras.Dq no
112*4d4057d8SBen Grasthen invoke
113*4d4057d8SBen Gras.Nm
114*4d4057d8SBen Grasfor the file system types that are not specified in the list.
115*4d4057d8SBen Gras.It Fl v
116*4d4057d8SBen GrasPrint the commands before executing them.
117*4d4057d8SBen Gras.It Fl x Ar mountpoint
118*4d4057d8SBen GrasExclude the filesystem which has a
119*4d4057d8SBen Gras.Ar mountpoint
120*4d4057d8SBen Grasthe same as in
121*4d4057d8SBen Gras.Pa /etc/fstab .
122*4d4057d8SBen GrasUsed only in
123*4d4057d8SBen Gras.Dq preen
124*4d4057d8SBen Grasmode.
125*4d4057d8SBen Gras.It Fl y
126*4d4057d8SBen GrasCauses
127*4d4057d8SBen Gras.Nm
128*4d4057d8SBen Grasto assume yes
129*4d4057d8SBen Grasas the answer to all operator questions.
130*4d4057d8SBen Gras.El
131*4d4057d8SBen Gras.Sh FILES
132*4d4057d8SBen Gras.Bl -tag -width /etc/fstab -compact
133*4d4057d8SBen Gras.It Pa /etc/fstab
134*4d4057d8SBen Grasfile system table
135*4d4057d8SBen Gras.El
136*4d4057d8SBen Gras.Sh EXIT STATUS
137*4d4057d8SBen Gras.Nm
138*4d4057d8SBen Grasexits with
139*4d4057d8SBen Gras.Dv 0
140*4d4057d8SBen Grason success.
141*4d4057d8SBen GrasAny major problems will cause
142*4d4057d8SBen Gras.Nm
143*4d4057d8SBen Grasto exit with the following non-zero
144*4d4057d8SBen Gras.Xr exit 3
145*4d4057d8SBen Grascodes, so as to alert any invoking program or script that human
146*4d4057d8SBen Grasintervention is required.
147*4d4057d8SBen Gras.Bl -tag -width XXXX
148*4d4057d8SBen Gras.It Dv 1
149*4d4057d8SBen GrasUsage problem.
150*4d4057d8SBen Gras.It Dv 2
151*4d4057d8SBen GrasUnresolved errors while checking the filesystem.
152*4d4057d8SBen GrasRe-running
153*4d4057d8SBen Gras.Nm
154*4d4057d8SBen Grason the filesystem(s) is required.
155*4d4057d8SBen Gras.It Dv 4
156*4d4057d8SBen GrasThe root filesystem was changed in the process of checking, and updating the
157*4d4057d8SBen Grasmount was unsuccessful.
158*4d4057d8SBen GrasA reboot (without sync) is required.
159*4d4057d8SBen Gras.It Dv 8
160*4d4057d8SBen GrasThe filesystem check has failed, and a subsequent check is required
161*4d4057d8SBen Grasthat will require human intervention.
162*4d4057d8SBen Gras.It Dv 12
163*4d4057d8SBen Gras.Nm
164*4d4057d8SBen Grasexited because of the result of a signal (usually
165*4d4057d8SBen Gras.Dv SIGINT
166*4d4057d8SBen Grasor
167*4d4057d8SBen Gras.Dv SIGQUIT
168*4d4057d8SBen Grasfrom the terminal).
169*4d4057d8SBen Gras.El
170*4d4057d8SBen Gras.Sh SEE ALSO
171*4d4057d8SBen Gras.Xr fstab 5 ,
172*4d4057d8SBen Gras.Xr fsck_ext2fs 8 ,
173*4d4057d8SBen Gras.Xr fsck_ffs 8 ,
174*4d4057d8SBen Gras.Xr fsck_lfs 8 ,
175*4d4057d8SBen Gras.Xr fsck_msdos 8 ,
176*4d4057d8SBen Gras.Xr mount 8
177