teach manpages about largefile's demise
[unleashed.git] / share / man / man8 / fsck_ufs.8
blobededfa41075c065287dc9b63bf3c55dcbe26ecd6
1 '\" te
2 .\" Copyright (c) 2003, Sun Microsystems, Inc.  All Rights Reserved
3 .\" Copyright 1989 AT&T
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH FSCK_UFS 8 "Aug 2, 2005"
8 .SH NAME
9 fsck_ufs \- file system consistency check and interactive repair
10 .SH SYNOPSIS
11 .LP
12 .nf
13 \fBfsck\fR \fB-F\fR ufs [\fIgeneric-options\fR] [\fIspecial\fR]...
14 .fi
16 .LP
17 .nf
18 \fBfsck\fR \fB-F\fR ufs [\fIgeneric-options\fR] [\fB-o\fR \fIspecific-options\fR]
19      [\fIspecial\fR]...
20 .fi
22 .SH DESCRIPTION
23 .sp
24 .LP
25 The \fBfsck\fR utility audits and interactively repairs inconsistent conditions
26 on file systems. A file system to be checked may be specified by giving the
27 name of the block or character \fIspecial\fR device or by giving the name of
28 its mount point if a matching entry exists in \fB/etc/vfstab\fR.
29 .sp
30 .LP
31 The \fIspecial\fR parameter represents the character special device, for
32 example, \fB/dev/rdsk/c1t0d0s7\fR, on which the file system resides. The
33 character special device, not the block special device should be used. The
34 \fBfsck\fR utility will not work if the block device is mounted, unless the
35 file system is error-locked.
36 .sp
37 .LP
38 If no \fIspecial\fR device is specified, all \fBufs\fR file systems specified
39 in the \fBvfstab\fR with a \fBfsckdev\fR entry will be checked. If the \fB-p\fR
40 (``preen'') option is specified, \fBufs\fR file systems with an \fBfsckpass\fR
41 number greater than \fB1\fR are checked in parallel. See \fBfsck\fR(8).
42 .sp
43 .LP
44 In the case of correcting serious inconsistencies, by default, \fBfsck\fR asks
45 for confirmation before making a repair and waits for the operator to respond
46 either \fByes\fR or \fBno\fR. If the operator does not have write permission on
47 the file system, \fBfsck\fR will default to a \fB-n\fR (no corrections) action.
48 See \fBfsck\fR(8).
49 .sp
50 .LP
51 Repairing some file system inconsistencies can result in loss of data. The
52 amount and severity of data loss can be determined from the diagnostic output.
53 .sp
54 .LP
55 The \fBfsck\fR utility automatically corrects innocuous inconsistencies such as
56 unreferenced inodes, too-large link counts in inodes, missing blocks in the
57 free list, blocks appearing in the free list and also in files, or incorrect
58 counts in the super block. It displays a message for each inconsistency
59 corrected that identifies the nature of the correction on the file system which
60 took place. After successfully correcting a file system, \fBfsck\fR prints the
61 number of files on that file system, the number of used and free blocks, and
62 the percentage of fragmentation.
63 .sp
64 .LP
65 Inconsistencies checked include:
66 .RS +4
67 .TP
68 .ie t \(bu
69 .el o
70 Blocks claimed by more than one inode or the free list.
71 .RE
72 .RS +4
73 .TP
74 .ie t \(bu
75 .el o
76 Blocks claimed by an inode or the free list outside the range of the file
77 system.
78 .RE
79 .RS +4
80 .TP
81 .ie t \(bu
82 .el o
83 Incorrect link counts.
84 .RE
85 .RS +4
86 .TP
87 .ie t \(bu
88 .el o
89 Incorrect directory sizes.
90 .RE
91 .RS +4
92 .TP
93 .ie t \(bu
94 .el o
95 Bad inode format.
96 .RE
97 .RS +4
98 .TP
99 .ie t \(bu
100 .el o
101 Blocks not accounted for anywhere.
103 .RS +4
105 .ie t \(bu
106 .el o
107 Directory checks, file pointing to unallocated inode, inode number out of
108 range, and absence of `\fB\&.\fR' and `\fB\&.\|.\fR' as the first two entries
109 in each directory.
111 .RS +4
113 .ie t \(bu
114 .el o
115 Super Block checks: more blocks for inodes than there are in the file system.
117 .RS +4
119 .ie t \(bu
120 .el o
121 Bad free block list format.
123 .RS +4
125 .ie t \(bu
126 .el o
127 Total free block and/or free inode count incorrect.
131 Orphaned files and directories (allocated but unreferenced) are, with the
132 operator's concurrence, reconnected by placing them in the \fBlost+found\fR
133 directory. The name assigned is the inode number. If the \fBlost+found\fR
134 directory does not exist, it is created. If there is insufficient space in the
135 \fBlost+found\fR directory, its size is increased.
138 An attempt to mount a \fBufs\fR file system with the \fB\fR\fB-o\fR\fB
139 nolargefiles\fR option will fail if the file system has ever contained a large
140 file (a file whose size is greater than or equal to 2 Gbyte). Invoking
141 \fBfsck\fR resets the file system state if no large files are present in the
142 file system. A successful mount of the file system after invoking \fBfsck\fR
143 indicates the absence of large files in the file system. An unsuccessful mount
144 attempt indicates the presence of at least one large file. See
145 \fBmount_ufs\fR(8).
146 .SH OPTIONS
149 The \fIgeneric-options\fR consist of the following options:
151 .ne 2
153 \fB\fB-m\fR\fR
155 .RS 12n
156 Check but do not repair. This option checks that the file system is suitable
157 for mounting, returning the appropriate exit status. If the file system is
158 ready for mounting, \fBfsck\fR displays a message such as:
160 .ne 2
162 \fB\fR
164 .sp .6
165 .RS 4n
166 \fBufs fsck: sanity check: /dev/rdsk/c0t3d0s1 okay\fR
172 .ne 2
174 \fB\fB-n\fR\||\|\fBN\fR\fR
176 .RS 12n
177 Assume a \fBno\fR response to all questions asked by \fBfsck\fR; do not open
178 the file system for writing.
182 .ne 2
184 \fB\fB-V\fR\fR
186 .RS 12n
187 Echo the expanded command line, but do not execute the command. This option may
188 be used to verify and to validate the command line.
192 .ne 2
194 \fB\fB-v\fR\fR
196 .RS 12n
197 Enables verbose output. Might not be supported by all filesystem-specific
198 \fBfsck\fR implementations.
202 .ne 2
204 \fB\fB-y\fR\||\|\fBY\fR\fR
206 .RS 12n
207 Assume a \fByes\fR response to all questions asked by \fBfsck\fR.
212 See generic \fBfsck\fR(8) for the details for specifying \fIspecial\fR.
214 .ne 2
216 \fB\fB-o\fR \fIspecific-options\fR\fR
218 .RS 23n
219 Specify \fBufs\fR file system specific options. These options can be any
220 combination of the following separated by commas (with no intervening spaces).
222 .ne 2
224 \fB\fBb=\fR\fIn\fR\fR
226 .RS 7n
227 Use block \fIn\fR as the super block for the file system. Block 32 is always
228 one of the alternate super blocks. Determine the location of other super blocks
229 by running \fBnewfs\fR(8) with the \fB-Nv\fR options specified.
233 .ne 2
235 \fB\fBf\fR\fR
237 .RS 7n
238 Force checking of file systems regardless of the state of their super block
239 clean flag.
243 .ne 2
245 \fB\fBp\fR\fR
247 .RS 7n
248 Check and fix the file system non-interactively ("preen"). Exit immediately if
249 there is a problem requiring intervention. This option is required to enable
250 parallel file system checking.
254 .ne 2
256 \fB\fBw\fR\fR
258 .RS 7n
259 Check writable file systems only.
264 .SH FILES
266 .ne 2
268 \fB\fB/etc/vfstab\fR\fR
270 .RS 15n
271 list of default parameters for each file system
274 .SH SEE ALSO
277 \fBclri\fR(8), \fBfsck\fR(8), \fBfsdb_ufs\fR(8), \fBfsirand\fR(8),
278 \fBfstyp\fR(8), \fBmkfs\fR(8), \fBmkfs_ufs\fR(8), \fBmount_ufs\fR(8),
279 \fBmountall\fR(8), \fBnewfs\fR(8), \fBreboot\fR(8), \fBvfstab\fR(4),
280 \fBattributes\fR(5), \fBufs\fR(7FS)
281 .SH WARNINGS
284 The operating system buffers file system data. Running \fBfsck\fR on a mounted
285 file system can cause the operating system's buffers to become out of date with
286 respect to the disk. For this reason, the file system should be \fIunmounted\fR
287 when \fBfsck\fR is used. If this is not possible, care should be taken that the
288 system is quiescent and that it is rebooted immediately after \fBfsck\fR is
289 run. Quite often, however, this will not be sufficient. A panic will probably
290 occur if running \fBfsck\fR on a file system modifies the file system.
291 .SH NOTES
294 It is usually faster to check the character special device than the block
295 special device.
298 Running \fBfsck\fR on file systems larger than 2 Gb fails if the user chooses
299 to use the block interface to the device:
301 .ne 2
303 \fB\fBfsck\fR \fB/dev/dsk/c?t?d?s?\fR\fR
305 .RS 26n
311 rather than the raw (character special) device:
313 .ne 2
315 \fB\fBfsck\fR \fB/dev/rdsk/c?t?d?s?\fR\fR
317 .RS 27n