1 .\" $NetBSD: 0.t,v 1.3 1996/04/05 01:45:40 cgd Exp $
3 .\" Copyright (c) 1986, 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 .\" @(#)0.t 8.1 (Berkeley) 6/8/93
34 Fsck_ffs \- The UNIX\(dg File System Check Program
35 .EH 'SMM:3-%''The \s-2UNIX\s+2 File System Check Program'
36 .OH 'The \s-2UNIX\s+2 File System Check Program''SMM:3-%'
38 Marshall Kirk McKusick
40 Computer Systems Research Group
41 Computer Science Division
42 Department of Electrical Engineering and Computer Science
43 University of California, Berkeley
49 Murray Hill, New Jersey 07974
52 \(dgUNIX is a trademark of Bell Laboratories.
55 This work was done under grants from
56 the National Science Foundation under grant MCS80-05144,
57 and the Defense Advance Research Projects Agency (DoD) under
58 Arpa Order No. 4031 monitored by Naval Electronic System Command under
59 Contract No. N00039-82-C-0235.
61 This document reflects the use of
63 with the 4.2BSD and 4.3BSD file system organization. This
65 original paper written by
68 File System Check Program (\fIfsck_ffs\fR)
69 is an interactive file system check and repair program.
71 uses the redundant structural information in the
72 UNIX file system to perform several consistency checks.
73 If an inconsistency is detected, it is reported
74 to the operator, who may elect to fix or ignore
76 These inconsistencies result from the permanent interruption
77 of the file system updates, which are performed every
78 time a file is modified.
79 Unless there has been a hardware failure,
81 is able to repair corrupted file systems
82 using procedures based upon the order in which UNIX honors
83 these file system update requests.
85 The purpose of this document is to describe the normal updating
87 to discuss the possible causes of file system corruption,
88 and to present the corrective actions implemented
91 Both the program and the interaction between the
92 program and the operator are described.
100 .B "TABLE OF CONTENTS"
108 .B "2. Overview of the file system
110 2.2. Summary Information
113 2.5. Updates to the file system
117 .B "3. Fixing corrupted file systems
118 3.1. Detecting and correcting corruption
119 3.2. Super block checking
120 3.3. Free block checking
121 3.4. Checking the inode state
124 3.7. Checking the data associated with an inode
125 3.8. File system connectivity
140 4.3. Phase 1 - Check Blocks and Sizes
141 4.4. Phase 1b - Rescan for more Dups
142 4.5. Phase 2 - Check Pathnames
143 4.6. Phase 3 - Check Connectivity
144 4.7. Phase 4 - Check Reference Counts
145 4.8. Phase 5 - Check Cyl groups