1 .\" $NetBSD: fsck_ext2fs.8,v 1.17 2009/03/15 10:01:47 joerg Exp $
3 .\" Copyright (c) 1980, 1989, 1991, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
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. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" Copyright (c) 1997 Manuel Bouyer.
32 .\" Redistribution and use in source and binary forms, with or without
33 .\" modification, are permitted provided that the following conditions
35 .\" 1. Redistributions of source code must retain the above copyright
36 .\" notice, this list of conditions and the following disclaimer.
37 .\" 2. Redistributions in binary form must reproduce the above copyright
38 .\" notice, this list of conditions and the following disclaimer in the
39 .\" documentation and/or other materials provided with the distribution.
41 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
42 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
43 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
44 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
45 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
46 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
47 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
48 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
49 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
50 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
52 .\" @(#)fsck.8 8.3 (Berkeley) 11/29/94
59 .Nd EXT2 File System consistency check and interactive repair
69 performs interactive filesystem consistency checks and repair for each of
70 the filesystems specified on the command line.
71 It is normally invoked from
74 The kernel takes care that only a restricted class of innocuous filesystem
75 inconsistencies can happen unless hardware or software failures intervene.
76 These are limited to the following:
82 Link counts in inodes too large
84 Missing blocks in the free map
86 Blocks in the free map also in files
88 Counts in the super-block wrong
91 These are the only inconsistencies that
97 option) will correct; if it encounters other inconsistencies, it exits
98 with an abnormal return status.
99 For each corrected inconsistency one or more lines will be printed
100 identifying the filesystem on which the correction will take place,
101 and the nature of the correction.
102 After successfully correcting a filesystem,
104 will print the number of files on that filesystem
105 and the number of used and free blocks.
111 will finish the filesystem checks, then exit with an abnormal return status.
117 audits and interactively repairs inconsistent conditions for filesystems.
118 If the filesystem is inconsistent the operator is prompted for concurrence
119 before each correction is attempted.
120 It should be noted that some of the corrective actions which are not
121 correctable under the
123 option will result in some loss of data.
124 The amount and severity of data lost may be determined from the diagnostic
126 The default action for each consistency correction
127 is to wait for the operator to respond
131 If the operator does not have write permission on the filesystem
137 The following flags are interpreted by
139 .Bl -tag -width indent
141 Use the block specified immediately after the flag as
142 the super block for the filesystem.
143 Block 8193 is usually an alternate super block.
145 Print debugging output.
147 Force checking of file systems.
148 Normally, if a file system is cleanly unmounted, the kernel will set a
150 in the file system superblock, and
152 will not check the file system.
155 to check the file system, regardless of the state of the clean flag.
157 Use the mode specified in octal immediately after the flag as the
158 permission bits to use when creating the
160 directory rather than the default 1777.
161 In particular, systems that do not wish to have lost files accessible
162 by all users on the system should use a more restrictive
163 set of permissions such as 700.
165 Assume a no response to all questions asked by
169 which is assumed to be affirmative;
170 do not open the filesystem for writing.
174 mode, described above.
176 Resolve numeric userids to usernames.
178 Assume a yes response to all questions asked by
180 this should be used with great caution as this is a free license
181 to continue after essentially unlimited trouble has been encountered.
184 Inconsistencies checked are as follows:
185 .Bl -enum -offset indent -compact
187 Blocks claimed by more than one inode or the free map.
189 Blocks claimed by an inode outside the range of the filesystem.
191 Incorrect link counts.
194 .Bl -item -offset indent -compact
196 Directory size not a multiple of filesystem block size.
198 Partially truncated file.
203 Blocks not accounted for anywhere.
206 .Bl -item -offset indent -compact
208 File pointing to unallocated inode.
210 Inode number out of range.
212 Dot or dot-dot not the first two entries of a directory
213 or having the wrong inode number.
217 .Bl -item -offset indent -compact
219 More blocks for inodes than there are in the filesystem.
221 Bad free block map format.
223 Total free block and/or free inode count incorrect.
227 Orphaned files and directories (allocated but unreferenced) are,
228 with the operator's concurrence, reconnected by
232 The name assigned is the inode number.
235 directory does not exist, it is created.
236 If there is insufficient space its size is increased.
238 Because of inconsistencies between the block device and the buffer cache,
239 the raw device should always be used.
241 The diagnostics produced by
243 are fully enumerated and explained in Appendix A of
245 .%T "Fsck \- The UNIX File System Check Program"