summaryrefslogtreecommitdiff
path: root/usr/src/man/man1m/fsck.1m
blob: 42fbf3a186a84ec837efeb18d9e9912e9e30a835 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
'\" te
.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved
.\" Copyright 2015 Nexenta Systems, Inc. All rights reserved.
.\" Copyright 1989 AT&T
.\" 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.
.\" 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.
.\" 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]
.TH FSCK 1M "Sep 8, 2015"
.SH NAME
fsck \- check and repair file systems
.SH SYNOPSIS
.LP
.nf
\fBfsck\fR [\fB-F\fR \fIFSType\fR] [\fB-m\fR] [\fB-V\fR] [\fB-v\fR] [\fIspecial\fR]...
.fi

.LP
.nf
\fBfsck\fR [\fB-F\fR \fIFSType\fR] [\fB-n\fR | N | y | Y] [\fB-V\fR] [\fB-v\fR]
     [\fB-o\fR \fIFSType-specific-options\fR] [\fIspecial\fR]...
.fi

.SH DESCRIPTION
.LP
\fBfsck\fR audits and interactively repairs inconsistent file system
conditions. If the file system is inconsistent the default action for each
correction is to wait for the user to respond \fByes\fR or \fBno\fR. If the
user does not have write permission \fBfsck\fR defaults to a \fBno\fR action.
Some corrective actions will result in loss of data. The amount and severity of
data loss can be determined from the diagnostic output.
.sp
.LP
\fIFSType-specific-options\fR are options specified in a comma-separated (with
no intervening spaces) list of options or keyword-attribute pairs for
interpretation by the \fIFSType-\fRspecific module of the command.
.sp
.LP
\fIspecial\fR represents the character special device on which the file system
resides, for example, \fB/dev/rdsk/c1t0d0s7\fR. Note: the character special
device, not the block special device, should be used. \fBfsck\fR will not work
if the block device is mounted.
.sp
.LP
If no \fIspecial\fR device is specified \fBfsck\fR checks the file systems
listed in \fB/etc/vfstab\fR. Those entries in \fB/etc/vfstab\fR which have a
character special device entry in the \fBfsckdev\fR field and have a non-zero
numeric entry in the \fBfsckpass\fR field will be checked. Specifying \fB-F\fR
\fIFSType\fR limits the file systems to be checked to those of the type
indicated.
.sp
.LP
If \fIspecial\fR is specified, but \fB-F\fR is not, the file system type will
be determined by looking for a matching entry in \fB/etc/vfstab\fR. If no entry
is found, the default local file system type specified in \fB/etc/default/fs\fR
will be used.
.sp
.LP
If a file system type supports parallel checking, for example, \fBufs,\fR some
file systems eligible for checking may be checked in parallel. Consult the file
system-specific man page (for example, \fBfsck_ufs\fR(1M)) for more
information.
.SH OPTIONS
.LP
The following generic options are supported:
.sp
.ne 2
.na
\fB\fB-F\fR \fIFSType\fR\fR
.ad
.sp .6
.RS 4n
Specify the file system type on which to operate.
.RE

.sp
.ne 2
.na
\fB\fB-m\fR\fR
.ad
.sp .6
.RS 4n
Check but do not repair. This option checks that the file system is suitable
for mounting, returning the appropriate exit status. If the file system is
ready for mounting, \fBfsck\fR displays a message such as:
.sp
.in +2
.nf
ufs fsck: sanity check: /dev/rdsk/c0t3d0s1 okay
.fi
.in -2
.sp

.RE

.sp
.ne 2
.na
\fB\fB-n\fR | \fB-N\fR\fR
.ad
.sp .6
.RS 4n
Assume a \fBno\fR response to all questions asked by \fBfsck\fR; do not open
the file system for writing.
.RE

.sp
.ne 2
.na
\fB\fB-V\fR\fR
.ad
.sp .6
.RS 4n
Echo the expanded command line but do not execute the command. This option may
be used to verify and to validate the command line.
.RE

.sp
.ne 2
.na
\fB\fB-v\fR\fR
.ad
.sp .6
.RS 4n
Enables verbose output. Might not be supported by all filesystem-specific
\fBfsck\fR implementations.
.RE

.sp
.ne 2
.na
\fB\fB-y\fR | \fBY\fR\fR
.ad
.sp .6
.RS 4n
Assume a \fByes\fR response to all questions asked by \fBfsck\fR.
.RE

.sp
.ne 2
.na
\fB\fB-o\fR \fIspecific-options\fR\fR
.ad
.sp .6
.RS 4n
These \fIspecific-options\fR can be any combination of the following separated
by commas (with no intervening spaces).
.sp
.ne 2
.na
\fB\fBb=\fR\fIn\fR\fR
.ad
.sp .6
.RS 4n
Use block \fIn\fR as the super block for the file system. Block 32 is always
one of the alternate super blocks. Determine the location of other super blocks
by running \fBnewfs\fR(1M) with the \fB-Nv\fR options specified.
.RE

.sp
.ne 2
.na
\fB\fBc\fR\fR
.ad
.sp .6
.RS 4n
If the file system is in the old (static table) format, convert it to the new
(dynamic table) format. If the file system is in the new format, convert it to
the old format provided the old format can support the file system
configuration. In interactive mode, \fBfsck\fR will list the direction the
conversion is to be made and ask whether the conversion should be done. If a
negative answer is given, no further operations are done on the file system. In
preen mode, the direction of the conversion is listed and done if possible
without user interaction. Conversion in preen mode is best used when all the
file systems are being converted at once. The format of a file system can be
determined from the first line of output from \fBfstyp\fR(1M). Note: the
\fBc\fR option is seldom used and is included only for compatibility with
pre-4.1 releases. There is no guarantee that this option will be included in
future releases.
.RE

.sp
.ne 2
.na
\fB\fBf\fR\fR
.ad
.sp .6
.RS 4n
Force checking of file systems regardless of the state of their super block
clean flag.
.RE

.sp
.ne 2
.na
\fB\fBp\fR\fR
.ad
.sp .6
.RS 4n
Check and fix the file system non-interactively ("preen"). Exit immediately if
there is a problem requiring intervention. This option is required to enable
parallel file system checking.
.RE

.sp
.ne 2
.na
\fB\fBw\fR\fR
.ad
.sp .6
.RS 4n
Check writable file systems only.
.RE

.RE

.SH EXIT STATUS
.ne 2
.na
\fB\fB0\fR\fR
.ad
.sp .6
.RS 4n
file system is unmounted and OK
.RE

.sp
.ne 2
.na
\fB\fB1\fR\fR
.ad
.sp .6
.RS 4n
erroneous parameters are specified
.RE

.sp
.ne 2
.na
\fB\fB32\fR\fR
.ad
.sp .6
.RS 4n
file system is unmounted and needs checking (\fBfsck\fR \fB-m\fR only)
.RE

.sp
.ne 2
.na
\fB\fB33\fR\fR
.ad
.sp .6
.RS 4n
file system is already mounted
.RE

.sp
.ne 2
.na
\fB\fB34\fR\fR
.ad
.sp .6
.RS 4n
cannot stat device
.RE

.sp
.ne 2
.na
\fB\fB35\fR\fR
.ad
.sp .6
.RS 4n
a filesystem that is mounted read/write was modified - reboot
.RE

.sp
.ne 2
.na
\fB\fB36\fR\fR
.ad
.sp .6
.RS 4n
uncorrectable errors detected - terminate normally
.RE

.sp
.ne 2
.na
\fB\fB37\fR\fR
.ad
.sp .6
.RS 4n
a signal was caught during processing
.RE

.sp
.ne 2
.na
\fB\fB39\fR\fR
.ad
.sp .6
.RS 4n
uncorrectable errors detected - terminate immediately
.RE

.sp
.ne 2
.na
\fB\fB40\fR\fR
.ad
.sp .6
.RS 4n
file system is mounted read-only and is OK
.RE

.SH USAGE
.LP
The \fBfsck\fR command is \fBlarge file aware\fR for UFS file systems, per the
\fBlargefile\fR(5) man page.
.SH FILES
.ne 2
.na
\fB\fB/etc/default/fs\fR\fR
.ad
.sp .6
.RS 4n
default local file system type. Default values can be set for the following
flags in \fB/etc/default/fs\fR. For example: \fBLOCAL=ufs.\fR
.sp
.ne 2
.na
\fB\fBLOCAL\fR\fR
.ad
.sp .6
.RS 4n
The default partition for a command if no FSType is specified.
.RE

.RE

.sp
.ne 2
.na
\fB\fB/etc/vfstab\fR\fR
.ad
.sp .6
.RS 4n
list of default parameters for each file system
.RE

.SH ATTRIBUTES
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Committed
.TE

.SH SEE ALSO
.LP
\fBclri\fR(1M), \fBfsck_ufs\fR(1M), \fBfsdb_ufs\fR(1M),
\fBfsirand\fR(1M), \fBfstyp\fR(1M), \fBmkfs\fR(1M), \fBmkfs_ufs\fR(1M),
\fBmountall\fR(1M), \fBnewfs\fR(1M), \fBreboot\fR(1M), \fBvfstab\fR(4),
\fBattributes\fR(5), \fBlargefile\fR(5), \fBufs\fR(7FS)
.SH WARNINGS
.LP
The operating system buffers file system data. Running \fBfsck\fR on a mounted
file system can cause the operating system's buffers to become out of date with
respect to the disk. For this reason, the file system should be \fIunmounted\fR
when \fBfsck\fR is used. If this is not possible, care should be taken that the
system is quiescent and that it is rebooted immediately after \fBfsck\fR is
run. Quite often, however, this will not be sufficient. A panic will probably
occur if running \fBfsck\fR on a file system modifies the file system.
.SH NOTES
.LP
This command may not be supported for all \fIFSTypes\fR.
.LP
Starting with Solaris 9, \fBfsck\fR manages extended attribute data on the
disk. (See \fBfsattr\fR(5) for a description of extended file attributes.) A
file system with extended attributes can be mounted on versions of Solaris that
are not attribute-aware (versions prior to Solaris 9), but the attributes will
not be accessible and \fBfsck\fR will strip them from the files and place them
in \fBlost+found\fR. Once the attributes have been stripped, the file system is
completely stable on versions of Solaris that are not attribute-aware, but
would be considered corrupted on attribute-aware versions. In the latter
circumstance, run the attribute-aware \fBfsck\fR to stabilize the file system
before using it in an attribute-aware environment.