1 .\" Copyright (c) 1986, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. Neither the name of the University nor the names of its contributors
13 .\" may be used to endorse or promote products derived from this software
14 .\" without specific prior written permission.
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 .\" @(#)0.t 8.1 (Berkeley) 6/8/93
31 Fsck_ffs \- The UNIX\(dg File System Check Program
32 .EH 'SMM:3-%''The \s-2UNIX\s+2 File System Check Program'
33 .OH 'The \s-2UNIX\s+2 File System Check Program''SMM:3-%'
35 Marshall Kirk McKusick
37 Computer Systems Research Group
38 Computer Science Division
39 Department of Electrical Engineering and Computer Science
40 University of California, Berkeley
46 Murray Hill, New Jersey 07974
49 \(dgUNIX is a trademark of Bell Laboratories.
52 This work was done under grants from
53 the National Science Foundation under grant MCS80-05144,
54 and the Defense Advance Research Projects Agency (DoD) under
55 Arpa Order No. 4031 monitored by Naval Electronic System Command under
56 Contract No. N00039-82-C-0235.
58 This document reflects the use of
60 with the 4.2BSD and 4.3BSD file system organization. This
62 original paper written by
65 File System Check Program (\fIfsck_ffs\fR)
66 is an interactive file system check and repair program.
68 uses the redundant structural information in the
69 UNIX file system to perform several consistency checks.
70 If an inconsistency is detected, it is reported
71 to the operator, who may elect to fix or ignore
73 These inconsistencies result from the permanent interruption
74 of the file system updates, which are performed every
75 time a file is modified.
76 Unless there has been a hardware failure,
78 is able to repair corrupted file systems
79 using procedures based upon the order in which UNIX honors
80 these file system update requests.
82 The purpose of this document is to describe the normal updating
84 to discuss the possible causes of file system corruption,
85 and to present the corrective actions implemented
88 Both the program and the interaction between the
89 program and the operator are described.
92 Revised October 7, 1996
97 .B "TABLE OF CONTENTS"
105 .B "2. Overview of the file system
107 2.2. Summary Information
110 2.5. Updates to the file system
114 .B "3. Fixing corrupted file systems
115 3.1. Detecting and correcting corruption
116 3.2. Super block checking
117 3.3. Free block checking
118 3.4. Checking the inode state
121 3.7. Checking the data associated with an inode
122 3.8. File system connectivity
137 4.3. Phase 1 - Check Blocks and Sizes
138 4.4. Phase 1b - Rescan for more Dups
139 4.5. Phase 2 - Check Pathnames
140 4.6. Phase 3 - Check Connectivity
141 4.7. Phase 4 - Check Reference Counts
142 4.8. Phase 5 - Check Cyl groups