1 .\" $NetBSD: fsck_lfs.8,v 1.21 2008/10/09 16:56:23 christos 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 .\" @(#)fsck.8 8.3 (Berkeley) 11/29/94
37 .Nd Log-structured File System consistency check and interactive repair
48 performs interactive filesystem consistency checks and repair for
49 each of the filesystems specified on the command line.
50 It is normally invoked from
53 The design of LFS takes care that no filesystem inconsistencies can
54 happen unless hardware or software failures intervene.
56 will report and optionally correct any such inconsistencies.
58 For each corrected inconsistency one or more lines will be printed
59 identifying the filesystem on which the correction will take place,
60 and the nature of the correction.
61 After successfully correcting a filesystem,
63 will print the number of files on that filesystem,
64 the number of used and free blocks,
65 and the percentage of fragmentation.
71 will finish the filesystem checks, then exit with an abnormal return status.
77 audits and interactively repairs inconsistent conditions for filesystems.
78 If the filesystem is inconsistent, the operator is prompted for concurrence
79 before each correction is attempted.
80 It should be noted that some of the corrective actions will result in
82 The amount and severity of data lost may be determined from the diagnostic
84 The default action for each consistency correction
85 is to wait for the operator to respond
89 If the operator does not have write permission on the filesystem
95 The following flags are interpreted by
97 .Bl -tag -width XbXblockXX
101 as the super block for the filesystem.
103 Print debugging output.
105 Force checking of file systems.
106 Normally, if a file system is cleanly unmounted, the kernel will
109 in the file system superblock, and
111 will not check the file system.
114 to check the file system, regardless of the state of the clean flag.
118 specified in octal as the permission bits to use when creating the
120 directory rather than the default 1700.
121 In particular, systems that do not wish to have lost files accessible
122 by all users on the system should use a more restrictive
123 set of permissions such as 700.
125 Assume a no response to all questions asked by
129 which is assumed to be affirmative;
130 do not open the filesystem for writing.
135 Currently, in this mode
137 rolls forward from the older checkpoint, and performs no other action.
139 Quiet mode, do not output any messages for clean filesystems.
141 Resolve user ids to user names.
143 Assume a yes response to all questions asked by
145 this should be used with great caution as this is a free license
146 to continue after essentially unlimited trouble has been encountered.
149 Inconsistencies checked are as follows:
150 .Bl -enum -offset indent -compact
152 Blocks claimed by more than one inode.
154 Blocks claimed by an inode outside the range of the filesystem.
156 Incorrect link counts.
159 .Bl -item -offset indent -compact
161 Directory size not a multiple of DIRBLKSIZ.
163 Partially truncated file.
169 .Bl -item -offset indent -compact
171 File pointing to unallocated inode.
173 Inode number out of range.
175 Dot or dot-dot not the first two entries of a directory
176 or having the wrong inode number.
180 .Bl -item -offset indent -compact
182 More blocks for inodes than there are in the filesystem.
186 .Bl -item -offset indent -compact
189 inodes on free list, or free inodes not on free list.
191 Segment block counts incorrect, or
193 segments containing live data.
197 Orphaned files and directories (allocated but unreferenced) are,
198 with the operator's concurrence, reconnected by
202 The name assigned is the inode number.
205 directory does not exist, it is created.
206 If there is insufficient space its size is increased.
208 Because of inconsistencies between the block device and the buffer cache,
209 the raw device should always be used.
211 The diagnostics produced by
213 are fully enumerated and explained in Appendix A of
215 .%T "Fsck \- The UNIX File System Check Program"
225 program was first made available in
230 program was taken from
232 what was not was written by
233 .An Konrad Schroder Aq perseant@NetBSD.org .