]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - share/doc/smm/03.fsck/0.t
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / share / doc / smm / 03.fsck / 0.t
1 .\" Copyright (c) 1986, 1993
2 .\"  The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
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 .\" 4. 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.
15 .\"
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
26 .\" SUCH DAMAGE.
27 .\"
28 .\"     $FreeBSD$
29 .\"     @(#)0.t 8.1 (Berkeley) 6/8/93
30 .\"
31 .if n .ND
32 .TL
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-%'
36 .AU
37 Marshall Kirk McKusick
38 .AI
39 Computer Systems Research Group
40 Computer Science Division
41 Department of Electrical Engineering and Computer Science
42 University of California, Berkeley
43 Berkeley, CA  94720
44 .AU
45 T. J. Kowalski
46 .AI
47 Bell Laboratories
48 Murray Hill, New Jersey 07974
49 .AB
50 .FS
51 \(dgUNIX is a trademark of Bell Laboratories.
52 .FE
53 .FS
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.
59 .FE
60 This document reflects the use of
61 .I fsck_ffs
62 with the 4.2BSD and 4.3BSD file system organization.  This
63 is a revision of the
64 original paper written by
65 T. J. Kowalski.
66 .PP
67 File System Check Program (\fIfsck_ffs\fR)
68 is an interactive file system check and repair program.
69 .I Fsck_ffs
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
74 each inconsistency.
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,
79 .I fsck_ffs
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.
83 .PP
84 The purpose of this document is to describe the normal updating
85 of the file system,
86 to discuss the possible causes of file system corruption,
87 and to present the corrective actions implemented
88 by
89 .I fsck_ffs.
90 Both the program and the interaction between the
91 program and the operator are described.
92 .sp 2
93 .LP
94 Revised October 7, 1996
95 .AE
96 .LP
97 .bp
98 .ce
99 .B "TABLE OF CONTENTS"
100 .LP
101 .sp 1
102 .nf
103 .B "1.  Introduction"
104 .LP
105 .sp .5v
106 .nf
107 .B "2.  Overview of the file system
108 2.1.    Superblock
109 2.2.    Summary Information
110 2.3.    Cylinder groups
111 2.4.    Fragments
112 2.5.    Updates to the file system
113 .LP
114 .sp .5v
115 .nf
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
121 3.5.    Inode links
122 3.6.    Inode data size
123 3.7.    Checking the data associated with an inode
124 3.8.    File system connectivity
125 .LP
126 .sp .5v
127 .nf
128 .B Acknowledgements
129 .LP
130 .sp .5v
131 .nf
132 .B References
133 .LP
134 .sp .5v
135 .nf
136 .B "4.  Appendix A
137 4.1.     Conventions
138 4.2.     Initialization
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
145 4.9.     Cleanup
146 .ds RH Introduction
147 .bp