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
  16 
  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
  22 
  23 .SH DESCRIPTION
  24 .sp
  25 .LP
  26 \fBfsck\fR audits and interactively repairs inconsistent file system
  27 conditions. If the file system is inconsistent the default action for each
  28 correction is to wait for the user to respond \fByes\fR or \fBno\fR. If the
  29 user does not have write permission \fBfsck\fR defaults to a \fBno\fR action.
  30 Some corrective actions will result in loss of data. The amount and severity of
  31 data loss can be determined from the diagnostic output.
  32 .sp
  33 .LP
  34 \fIFSType-specific-options\fR are options specified in a comma-separated (with
  35 no intervening spaces) list of options or keyword-attribute pairs for
  36 interpretation by the \fIFSType-\fRspecific module of the command.
  37 .sp
  38 .LP
  39 \fIspecial\fR represents the character special device on which the file system
  40 resides, for example, \fB/dev/rdsk/c1t0d0s7\fR. Note: the character special
  41 device, not the block special device, should be used. \fBfsck\fR will not work
  42 if the block device is mounted.
  43 .sp
  44 .LP
  45 If no \fIspecial\fR device is specified \fBfsck\fR checks the file systems
  46 listed in \fB/etc/vfstab\fR. Those entries in \fB/etc/vfstab\fR which have a
  47 character special device entry in the \fBfsckdev\fR field and have a non-zero
  48 numeric entry in the \fBfsckpass\fR field will be checked. Specifying \fB-F\fR
  49 \fIFSType\fR limits the file systems to be checked to those of the type
  50 indicated.
  51 .sp
  52 .LP
  53 If \fIspecial\fR is specified, but \fB-F\fR is not, the file system type will
  54 be determined by looking for a matching entry in \fB/etc/vfstab\fR. If no entry
  55 is found, the default local file system type specified in \fB/etc/default/fs\fR
  56 will be used.
  57 .sp
  58 .LP
  59 If a file system type supports parallel checking, for example, \fBufs,\fR some
  60 file systems eligible for checking may be checked in parallel. Consult the file
  61 system-specific man page (for example, \fBfsck_ufs\fR(1M)) for more
  62 information.
  63 .SH OPTIONS
  64 .sp
  65 .LP
  66 The following generic options are supported:
  67 .sp
  68 .ne 2
  69 .na
  70 \fB\fB-F\fR \fIFSType\fR\fR
  71 .ad
  72 .sp .6
  73 .RS 4n
  74 Specify the file system type on which to operate.
  75 .RE
  76 
  77 .sp
  78 .ne 2
  79 .na
  80 \fB\fB-m\fR\fR
  81 .ad
  82 .sp .6
  83 .RS 4n
  84 Check but do not repair. This option checks that the file system is suitable
  85 for mounting, returning the appropriate exit status. If the file system is
  86 ready for mounting, \fBfsck\fR displays a message such as:
  87 .sp
  88 .in +2
  89 .nf
  90 ufs fsck: sanity check: /dev/rdsk/c0t3d0s1 okay
  91 .fi
  92 .in -2
  93 .sp
  94 
  95 .RE
  96 
  97 .sp
  98 .ne 2
  99 .na
 100 \fB\fB-n\fR | \fB-N\fR\fR
 101 .ad
 102 .sp .6
 103 .RS 4n
 104 Assume a \fBno\fR response to all questions asked by \fBfsck\fR; do not open
 105 the file system for writing.
 106 .RE
 107 
 108 .sp
 109 .ne 2
 110 .na
 111 \fB\fB-V\fR\fR
 112 .ad
 113 .sp .6
 114 .RS 4n
 115 Echo the expanded command line but do not execute the command. This option may
 116 be used to verify and to validate the command line.
 117 .RE
 118 
 119 .sp
 120 .ne 2
 121 .na
 122 \fB\fB-v\fR\fR
 123 .ad
 124 .sp .6
 125 .RS 4n
 126 Enables verbose output. Might not be supported by all filesystem-specific
 127 \fBfsck\fR implementations.
 128 .RE
 129 
 130 .sp
 131 .ne 2
 132 .na
 133 \fB\fB-y\fR | \fBY\fR\fR
 134 .ad
 135 .sp .6
 136 .RS 4n
 137 Assume a \fByes\fR response to all questions asked by \fBfsck\fR.
 138 .RE
 139 
 140 .sp
 141 .ne 2
 142 .na
 143 \fB\fB-o\fR \fIspecific-options\fR\fR
 144 .ad
 145 .sp .6
 146 .RS 4n
 147 These \fIspecific-options\fR can be any combination of the following separated
 148 by commas (with no intervening spaces).
 149 .sp
 150 .ne 2
 151 .na
 152 \fB\fBb=\fR\fIn\fR\fR
 153 .ad
 154 .sp .6
 155 .RS 4n
 156 Use block \fIn\fR as the super block for the file system. Block 32 is always
 157 one of the alternate super blocks. Determine the location of other super blocks
 158 by running \fBnewfs\fR(1M) with the \fB-Nv\fR options specified.
 159 .RE
 160 
 161 .sp
 162 .ne 2
 163 .na
 164 \fB\fBc\fR\fR
 165 .ad
 166 .sp .6
 167 .RS 4n
 168 If the file system is in the old (static table) format, convert it to the new
 169 (dynamic table) format. If the file system is in the new format, convert it to
 170 the old format provided the old format can support the file system
 171 configuration. In interactive mode, \fBfsck\fR will list the direction the
 172 conversion is to be made and ask whether the conversion should be done. If a
 173 negative answer is given, no further operations are done on the file system. In
 174 preen mode, the direction of the conversion is listed and done if possible
 175 without user interaction. Conversion in preen mode is best used when all the
 176 file systems are being converted at once. The format of a file system can be
 177 determined from the first line of output from \fBfstyp\fR(1M). Note: the
 178 \fBc\fR option is seldom used and is included only for compatibility with
 179 pre-4.1 releases. There is no guarantee that this option will be included in
 180 future releases.
 181 .RE
 182 
 183 .sp
 184 .ne 2
 185 .na
 186 \fB\fBf\fR\fR
 187 .ad
 188 .sp .6
 189 .RS 4n
 190 Force checking of file systems regardless of the state of their super block
 191 clean flag.
 192 .RE
 193 
 194 .sp
 195 .ne 2
 196 .na
 197 \fB\fBp\fR\fR
 198 .ad
 199 .sp .6
 200 .RS 4n
 201 Check and fix the file system non-interactively ("preen"). Exit immediately if
 202 there is a problem requiring intervention. This option is required to enable
 203 parallel file system checking.
 204 .RE
 205 
 206 .sp
 207 .ne 2
 208 .na
 209 \fB\fBw\fR\fR
 210 .ad
 211 .sp .6
 212 .RS 4n
 213 Check writable file systems only.
 214 .RE
 215 
 216 .RE
 217 
 218 .SH EXIT STATUS
 219 .sp
 220 .ne 2
 221 .na
 222 \fB\fB0\fR\fR
 223 .ad
 224 .sp .6
 225 .RS 4n
 226 file system is unmounted and OK
 227 .RE
 228 
 229 .sp
 230 .ne 2
 231 .na
 232 \fB\fB1\fR\fR
 233 .ad
 234 .sp .6
 235 .RS 4n
 236 erroneous parameters are specified
 237 .RE
 238 
 239 .sp
 240 .ne 2
 241 .na
 242 \fB\fB32\fR\fR
 243 .ad
 244 .sp .6
 245 .RS 4n
 246 file system is unmounted and needs checking (\fBfsck\fR \fB-m\fR only)
 247 .RE
 248 
 249 .sp
 250 .ne 2
 251 .na
 252 \fB\fB33\fR\fR
 253 .ad
 254 .sp .6
 255 .RS 4n
 256 file system is already mounted
 257 .RE
 258 
 259 .sp
 260 .ne 2
 261 .na
 262 \fB\fB34\fR\fR
 263 .ad
 264 .sp .6
 265 .RS 4n
 266 cannot stat device
 267 .RE
 268 
 269 .sp
 270 .ne 2
 271 .na
 272 \fB\fB35\fR\fR
 273 .ad
 274 .sp .6
 275 .RS 4n
 276 a filesystem that is mounted read/write was modified - reboot
 277 .RE
 278 
 279 .sp
 280 .ne 2
 281 .na
 282 \fB\fB36\fR\fR
 283 .ad
 284 .sp .6
 285 .RS 4n
 286 uncorrectable errors detected - terminate normally
 287 .RE
 288 
 289 .sp
 290 .ne 2
 291 .na
 292 \fB\fB37\fR\fR
 293 .ad
 294 .sp .6
 295 .RS 4n
 296 a signal was caught during processing
 297 .RE
 298 
 299 .sp
 300 .ne 2
 301 .na
 302 \fB\fB39\fR\fR
 303 .ad
 304 .sp .6
 305 .RS 4n
 306 uncorrectable errors detected - terminate immediately
 307 .RE
 308 
 309 .sp
 310 .ne 2
 311 .na
 312 \fB\fB40\fR\fR
 313 .ad
 314 .sp .6
 315 .RS 4n
 316 file system is mounted read-only and is OK
 317 .RE
 318 
 319 .SH USAGE
 320 .sp
 321 .LP
 322 The \fBfsck\fR command is \fBlarge file aware\fR for UFS file systems, per the
 323 \fBlargefile\fR(5) man page.
 324 .SH FILES
 325 .sp
 326 .ne 2
 327 .na
 328 \fB\fB/etc/default/fs\fR\fR
 329 .ad
 330 .sp .6
 331 .RS 4n
 332 default local file system type. Default values can be set for the following
 333 flags in \fB/etc/default/fs\fR. For example: \fBLOCAL=ufs.\fR
 334 .sp
 335 .ne 2
 336 .na
 337 \fB\fBLOCAL\fR\fR
 338 .ad
 339 .sp .6
 340 .RS 4n
 341 The default partition for a command if no FSType is specified.
 342 .RE
 343 
 344 .RE
 345 
 346 .sp
 347 .ne 2
 348 .na
 349 \fB\fB/etc/vfstab\fR\fR
 350 .ad
 351 .sp .6
 352 .RS 4n
 353 list of default parameters for each file system
 354 .RE
 355 
 356 .SH ATTRIBUTES
 357 .sp
 358 .LP
 359 See \fBattributes\fR(5) for descriptions of the following attributes:
 360 .sp
 361 
 362 .sp
 363 .TS
 364 box;
 365 c | c
 366 l | l .
 367 ATTRIBUTE TYPE  ATTRIBUTE VALUE
 368 _
 369 Interface Stability     Committed
 370 .TE
 371 
 372 .SH SEE ALSO
 373 .sp
 374 .LP
 375 \fBclri\fR(1M), \fBfsck_ufs\fR(1M), \fBfsdb_ufs\fR(1M),
 376 \fBfsirand\fR(1M), \fBfstyp\fR(1M), \fBmkfs\fR(1M), \fBmkfs_ufs\fR(1M),
 377 \fBmountall\fR(1M), \fBnewfs\fR(1M), \fBreboot\fR( 1M), \fBvfstab\fR(4),
 378 \fBattributes\fR(5), \fBlargefile\fR(5), \fBufs\fR(7FS)
 379 .SH WARNINGS
 380 .sp
 381 .LP
 382 The operating system buffers file system data. Running \fBfsck\fR on a mounted
 383 file system can cause the operating system's buffers to become out of date with
 384 respect to the disk. For this reason, the file system should be \fIunmounted\fR
 385 when \fBfsck\fR is used. If this is not possible, care should be taken that the
 386 system is quiescent and that it is rebooted immediately after \fBfsck\fR is
 387 run. Quite often, however, this will not be sufficient. A panic will probably
 388 occur if running \fBfsck\fR on a file system modifies the file system.
 389 .SH NOTES
 390 .sp
 391 .LP
 392 This command may not be supported for all \fIFSTypes\fR.
 393 .sp
 394 .LP
 395 Starting with Solaris 9, \fBfsck\fR manages extended attribute data on the
 396 disk. (See \fBfsattr\fR(5) for a description of extended file attributes.) A
 397 file system with extended attributes can be mounted on versions of Solaris that
 398 are not attribute-aware (versions prior to Solaris 9), but the attributes will
 399 not be accessible and \fBfsck\fR will strip them from the files and place them
 400 in \fBlost+found\fR. Once the attributes have been stripped, the file system is
 401 completely stable on versions of Solaris that are not attribute-aware, but
 402 would be considered corrupted on attribute-aware versions. In the latter
 403 circumstance, run the attribute-aware \fBfsck\fR to stabilize the file system
 404 before using it in an attribute-aware environment.