snj doesn't like my accent, so use proper English month names.
[netbsd-mini2440.git] / sbin / fsck / fsck.8
blobc58b800f584f8094f5175c271a83ac1866fce210
1 .\"     $NetBSD: fsck.8,v 1.34 2008/02/24 00:34:51 reed Exp $
2 .\"
3 .\" Copyright (c) 1996 Christos Zoulas.  All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
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 .\"
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 .\"
25 .Dd February 23, 2008
26 .Dt FSCK 8
27 .Os
28 .Sh NAME
29 .Nm fsck
30 .Nd file system consistency check and interactive repair
31 .Sh SYNOPSIS
32 .Nm
33 .Op Fl dfnPpqvy
34 .Op Fl l Ar maxparallel
35 .Op Fl T Ar fstype:fsoptions
36 .Op Fl t Ar fstype
37 .Op special | node ...
38 .Sh DESCRIPTION
39 The
40 .Nm
41 command invokes file system-specific programs to check
42 the special devices listed in the
43 .Xr fstab 5
44 file or in the command line for consistency.
45 .Pp
46 It is normally used in the script
47 .Pa /etc/rc
48 during automatic reboot.
49 If no file systems are specified, and ``preen'' mode is enabled (
50 .Fl p
51 option)
52 .Nm
53 reads the table
54 .Pa /etc/fstab
55 to determine which file systems to check, in what order.
56 Only partitions in fstab that are mounted ``rw,'' ``rq'' or ``ro''
57 and that have non-zero pass number are checked.
58 File systems with pass number 1 (normally just the root file system)
59 are checked one at a time.
60 When pass 1 completes, all remaining file systems are checked,
61 running one process per disk drive.
62 By default, file systems which are already mounted read-write are not checked.
63 The disk drive containing each file system is inferred from the longest prefix
64 of the device name that ends in a digit; the remaining characters are assumed
65 to be the partition designator.
66 .Pp
67 The options are as follows:
68 .Bl -tag -width indent
69 .It Fl d
70 Debugging mode.
71 Just print the commands without executing them.
72 .It Fl f
73 Force checking of file systems, even when they are marked clean (for file
74 systems that support this), or when they are mounted read-write.
75 .It Fl l Ar maxparallel
76 Limit the number of parallel checks to the number specified in
77 the following argument.
78 By default, the limit is the number of disks, running one process per disk.
79 If a smaller limit is given, the disks are checked round-robin,
80 one file system at a time.
81 .It Fl n
82 Causes
83 .Nm
84 to assume no as the answer to all operator questions, except "CONTINUE?".
85 .It Fl P
86 Display a progress meter for each file system check.
87 This option also disables parallel checking.
88 Note that progress meters are not supported by all file system types.
89 .It Fl p
90 Enter preen mode.
91 In preen mode,
92 .Nm
93 will check all file systems listed in
94 .Pa /etc/fstab
95 according to their pass number, and will make minor repairs without
96 human intervention.
97 .It Fl q
98 Quiet mode, do not output any messages for clean filesystems.
99 .It Fl T Ar fstype:fsoptions
100 List of comma separated file system specific options for the specified
101 file system type, in the same format as
102 .Xr mount 8 .
103 .It Fl t Ar fstype
104 Invoke
106 only for the comma separated list of file system types.
107 If the list starts with
108 .Dq no
109 then invoke
111 for the file system types that are not specified in the list.
112 .It Fl v
113 Print the commands before executing them.
114 .It Fl y
115 Causes
117 to assume yes
118 as the answer to all operator questions.
120 .Sh EXIT STATUS
122 exits with 
123 .Dv 0
124 on success.
125 Any major problems will cause
127 to exit with the following non-zero
128 .Xr exit 3
129 codes, so as to alert any invoking program or script that human
130 intervention is required.
131 .Bl -tag -width XXXX
132 .It Dv 1
133 Usage problem.
134 .It Dv 2
135 Unresolved errors while checking the filesystem.
136 Re-running
138 on the filesystem(s) is required.
139 .It Dv 4
140 The root filesystem was changed in the process of checking, and updating the
141 mount was unsuccessful. A reboot (without sync) is required.
142 .It Dv 8
143 The filesystem check has failed, and a subsequent check is required
144 that will require human intervention.
145 .It Dv 12 
147 exited because of the result of a signal (usually
148 .Dv SIGINT
150 .Dv SIGQUIT
151 from the terminal).
153 .Sh FILES
154 .Bl -tag -width /etc/fstab -compact
155 .It Pa /etc/fstab
156 file system table
158 .Sh SEE ALSO
159 .Xr fstab 5 ,
160 .Xr fsck_ext2fs 8 ,
161 .Xr fsck_ffs 8 ,
162 .Xr fsck_lfs 8 ,
163 .Xr fsck_msdos 8 ,
164 .Xr mount 8