6324 Add an `ndp' tool for manipulating the neighbors table
[illumos-gate.git] / usr / src / man / man1m / fsck.1m
blob9b415adfe697d73a1510d94a1709da1c597a15dd
1 '\" te
2 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved
3 .\" Copyright 2015 Nexenta Systems, Inc. All rights reserved.
4 .\" Copyright 1989 AT&T
5 .\" 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.
6 .\" 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.
7 .\" 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]
8 .TH FSCK 1M "Sep 8, 2015"
9 .SH NAME
10 fsck \- check and repair file systems
11 .SH SYNOPSIS
12 .LP
13 .nf
14 \fBfsck\fR [\fB-F\fR \fIFSType\fR] [\fB-m\fR] [\fB-V\fR] [\fB-v\fR] [\fIspecial\fR]...
15 .fi
17 .LP
18 .nf
19 \fBfsck\fR [\fB-F\fR \fIFSType\fR] [\fB-n\fR | N | y | Y] [\fB-V\fR] [\fB-v\fR]
20      [\fB-o\fR \fIFSType-specific-options\fR] [\fIspecial\fR]...
21 .fi
23 .SH DESCRIPTION
24 .LP
25 \fBfsck\fR audits and interactively repairs inconsistent file system
26 conditions. If the file system is inconsistent the default action for each
27 correction is to wait for the user to respond \fByes\fR or \fBno\fR. If the
28 user does not have write permission \fBfsck\fR defaults to a \fBno\fR action.
29 Some corrective actions will result in loss of data. The amount and severity of
30 data loss can be determined from the diagnostic output.
31 .sp
32 .LP
33 \fIFSType-specific-options\fR are options specified in a comma-separated (with
34 no intervening spaces) list of options or keyword-attribute pairs for
35 interpretation by the \fIFSType-\fRspecific module of the command.
36 .sp
37 .LP
38 \fIspecial\fR represents the character special device on which the file system
39 resides, for example, \fB/dev/rdsk/c1t0d0s7\fR. Note: the character special
40 device, not the block special device, should be used. \fBfsck\fR will not work
41 if the block device is mounted.
42 .sp
43 .LP
44 If no \fIspecial\fR device is specified \fBfsck\fR checks the file systems
45 listed in \fB/etc/vfstab\fR. Those entries in \fB/etc/vfstab\fR which have a
46 character special device entry in the \fBfsckdev\fR field and have a non-zero
47 numeric entry in the \fBfsckpass\fR field will be checked. Specifying \fB-F\fR
48 \fIFSType\fR limits the file systems to be checked to those of the type
49 indicated.
50 .sp
51 .LP
52 If \fIspecial\fR is specified, but \fB-F\fR is not, the file system type will
53 be determined by looking for a matching entry in \fB/etc/vfstab\fR. If no entry
54 is found, the default local file system type specified in \fB/etc/default/fs\fR
55 will be used.
56 .sp
57 .LP
58 If a file system type supports parallel checking, for example, \fBufs,\fR some
59 file systems eligible for checking may be checked in parallel. Consult the file
60 system-specific man page (for example, \fBfsck_ufs\fR(1M)) for more
61 information.
62 .SH OPTIONS
63 .LP
64 The following generic options are supported:
65 .sp
66 .ne 2
67 .na
68 \fB\fB-F\fR \fIFSType\fR\fR
69 .ad
70 .sp .6
71 .RS 4n
72 Specify the file system type on which to operate.
73 .RE
75 .sp
76 .ne 2
77 .na
78 \fB\fB-m\fR\fR
79 .ad
80 .sp .6
81 .RS 4n
82 Check but do not repair. This option checks that the file system is suitable
83 for mounting, returning the appropriate exit status. If the file system is
84 ready for mounting, \fBfsck\fR displays a message such as:
85 .sp
86 .in +2
87 .nf
88 ufs fsck: sanity check: /dev/rdsk/c0t3d0s1 okay
89 .fi
90 .in -2
91 .sp
93 .RE
95 .sp
96 .ne 2
97 .na
98 \fB\fB-n\fR | \fB-N\fR\fR
99 .ad
100 .sp .6
101 .RS 4n
102 Assume a \fBno\fR response to all questions asked by \fBfsck\fR; do not open
103 the file system for writing.
107 .ne 2
109 \fB\fB-V\fR\fR
111 .sp .6
112 .RS 4n
113 Echo the expanded command line but do not execute the command. This option may
114 be used to verify and to validate the command line.
118 .ne 2
120 \fB\fB-v\fR\fR
122 .sp .6
123 .RS 4n
124 Enables verbose output. Might not be supported by all filesystem-specific
125 \fBfsck\fR implementations.
129 .ne 2
131 \fB\fB-y\fR | \fBY\fR\fR
133 .sp .6
134 .RS 4n
135 Assume a \fByes\fR response to all questions asked by \fBfsck\fR.
139 .ne 2
141 \fB\fB-o\fR \fIspecific-options\fR\fR
143 .sp .6
144 .RS 4n
145 These \fIspecific-options\fR can be any combination of the following separated
146 by commas (with no intervening spaces).
148 .ne 2
150 \fB\fBb=\fR\fIn\fR\fR
152 .sp .6
153 .RS 4n
154 Use block \fIn\fR as the super block for the file system. Block 32 is always
155 one of the alternate super blocks. Determine the location of other super blocks
156 by running \fBnewfs\fR(1M) with the \fB-Nv\fR options specified.
160 .ne 2
162 \fB\fBc\fR\fR
164 .sp .6
165 .RS 4n
166 If the file system is in the old (static table) format, convert it to the new
167 (dynamic table) format. If the file system is in the new format, convert it to
168 the old format provided the old format can support the file system
169 configuration. In interactive mode, \fBfsck\fR will list the direction the
170 conversion is to be made and ask whether the conversion should be done. If a
171 negative answer is given, no further operations are done on the file system. In
172 preen mode, the direction of the conversion is listed and done if possible
173 without user interaction. Conversion in preen mode is best used when all the
174 file systems are being converted at once. The format of a file system can be
175 determined from the first line of output from \fBfstyp\fR(1M). Note: the
176 \fBc\fR option is seldom used and is included only for compatibility with
177 pre-4.1 releases. There is no guarantee that this option will be included in
178 future releases.
182 .ne 2
184 \fB\fBf\fR\fR
186 .sp .6
187 .RS 4n
188 Force checking of file systems regardless of the state of their super block
189 clean flag.
193 .ne 2
195 \fB\fBp\fR\fR
197 .sp .6
198 .RS 4n
199 Check and fix the file system non-interactively ("preen"). Exit immediately if
200 there is a problem requiring intervention. This option is required to enable
201 parallel file system checking.
205 .ne 2
207 \fB\fBw\fR\fR
209 .sp .6
210 .RS 4n
211 Check writable file systems only.
216 .SH EXIT STATUS
217 .ne 2
219 \fB\fB0\fR\fR
221 .sp .6
222 .RS 4n
223 file system is unmounted and OK
227 .ne 2
229 \fB\fB1\fR\fR
231 .sp .6
232 .RS 4n
233 erroneous parameters are specified
237 .ne 2
239 \fB\fB32\fR\fR
241 .sp .6
242 .RS 4n
243 file system is unmounted and needs checking (\fBfsck\fR \fB-m\fR only)
247 .ne 2
249 \fB\fB33\fR\fR
251 .sp .6
252 .RS 4n
253 file system is already mounted
257 .ne 2
259 \fB\fB34\fR\fR
261 .sp .6
262 .RS 4n
263 cannot stat device
267 .ne 2
269 \fB\fB35\fR\fR
271 .sp .6
272 .RS 4n
273 a filesystem that is mounted read/write was modified - reboot
277 .ne 2
279 \fB\fB36\fR\fR
281 .sp .6
282 .RS 4n
283 uncorrectable errors detected - terminate normally
287 .ne 2
289 \fB\fB37\fR\fR
291 .sp .6
292 .RS 4n
293 a signal was caught during processing
297 .ne 2
299 \fB\fB39\fR\fR
301 .sp .6
302 .RS 4n
303 uncorrectable errors detected - terminate immediately
307 .ne 2
309 \fB\fB40\fR\fR
311 .sp .6
312 .RS 4n
313 file system is mounted read-only and is OK
316 .SH USAGE
318 The \fBfsck\fR command is \fBlarge file aware\fR for UFS file systems, per the
319 \fBlargefile\fR(5) man page.
320 .SH FILES
321 .ne 2
323 \fB\fB/etc/default/fs\fR\fR
325 .sp .6
326 .RS 4n
327 default local file system type. Default values can be set for the following
328 flags in \fB/etc/default/fs\fR. For example: \fBLOCAL=ufs.\fR
330 .ne 2
332 \fB\fBLOCAL\fR\fR
334 .sp .6
335 .RS 4n
336 The default partition for a command if no FSType is specified.
342 .ne 2
344 \fB\fB/etc/vfstab\fR\fR
346 .sp .6
347 .RS 4n
348 list of default parameters for each file system
351 .SH ATTRIBUTES
353 See \fBattributes\fR(5) for descriptions of the following attributes:
358 box;
359 c | c
360 l | l .
361 ATTRIBUTE TYPE  ATTRIBUTE VALUE
363 Interface Stability     Committed
366 .SH SEE ALSO
368 \fBclri\fR(1M), \fBfsck_ufs\fR(1M), \fBfsdb_ufs\fR(1M),
369 \fBfsirand\fR(1M), \fBfstyp\fR(1M), \fBmkfs\fR(1M), \fBmkfs_ufs\fR(1M),
370 \fBmountall\fR(1M), \fBnewfs\fR(1M), \fBreboot\fR( 1M), \fBvfstab\fR(4),
371 \fBattributes\fR(5), \fBlargefile\fR(5), \fBufs\fR(7FS)
372 .SH WARNINGS
374 The operating system buffers file system data. Running \fBfsck\fR on a mounted
375 file system can cause the operating system's buffers to become out of date with
376 respect to the disk. For this reason, the file system should be \fIunmounted\fR
377 when \fBfsck\fR is used. If this is not possible, care should be taken that the
378 system is quiescent and that it is rebooted immediately after \fBfsck\fR is
379 run. Quite often, however, this will not be sufficient. A panic will probably
380 occur if running \fBfsck\fR on a file system modifies the file system.
381 .SH NOTES
383 This command may not be supported for all \fIFSTypes\fR.
385 Starting with Solaris 9, \fBfsck\fR manages extended attribute data on the
386 disk. (See \fBfsattr\fR(5) for a description of extended file attributes.) A
387 file system with extended attributes can be mounted on versions of Solaris that
388 are not attribute-aware (versions prior to Solaris 9), but the attributes will
389 not be accessible and \fBfsck\fR will strip them from the files and place them
390 in \fBlost+found\fR. Once the attributes have been stripped, the file system is
391 completely stable on versions of Solaris that are not attribute-aware, but
392 would be considered corrupted on attribute-aware versions. In the latter
393 circumstance, run the attribute-aware \fBfsck\fR to stabilize the file system
394 before using it in an attribute-aware environment.