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