1.\" $NetBSD: fsck.8,v 1.26 2001/12/20 20:10:36 soren Exp $ 2.\" 3.\" Copyright (c) 1996 Christos Zoulas. All rights reserved. 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright 9.\" notice, this list of conditions and the following disclaimer. 10.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" notice, this list of conditions and the following disclaimer in the 12.\" documentation and/or other materials provided with the distribution. 13.\" 3. All advertising materials mentioning features or use of this software 14.\" must display the following acknowledgement: 15.\" This product includes software developed by Christos Zoulas. 16.\" 4. The name of the author may not be used to endorse or promote products 17.\" derived from this software without specific prior written permission. 18.\" 19.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29.\" 30.Dd June 18, 2001 31.Dt FSCK 8 32.Os 33.Sh NAME 34.Nm fsck 35.Nd file system consistency check and interactive repair 36.Sh SYNOPSIS 37.Nm "" 38.Op Fl dfnpvy 39.Op Fl l Ar maxparallel 40.Op Fl t Ar fstype 41.Op Fl T Ar fstype:fsoptions 42.Op special | node ... 43.Sh DESCRIPTION 44The 45.Nm 46command invokes file system-specific programs to check 47the special devices listed in the 48.Xr fstab 5 49file or in the command line for consistency. 50.Pp 51It is normally used in the script 52.Pa /etc/rc 53during automatic reboot. 54If no file systems are specified, and ``preen'' mode is enabled ( 55.Fl p 56option) 57.Nm 58reads the table 59.Pa /etc/fstab 60to determine which file systems to check, in what order. 61Only partitions in fstab that are mounted ``rw,'' ``rq'' or ``ro'' 62and that have non-zero pass number are checked. 63File systems with pass number 1 (normally just the root file system) 64are checked one at a time. 65When pass 1 completes, all remaining file systems are checked, 66running one process per disk drive. 67By default, file systems which are already mounted read-write are not checked. 68The disk drive containing each file system is inferred from the longest prefix 69of the device name that ends in a digit; the remaining characters are assumed 70to be the partition designator. 71.Pp 72The options are as follows: 73.Bl -tag -width indent 74.It Fl d 75Debugging mode. Just print the commands without executing them. 76.It Fl f 77Force checking of file systems, even when they are marked clean (for file 78systems that support this), or when they are mounted read-write. 79.It Fl l Ar maxparallel 80Limit the number of parallel checks to the number specified in 81the following argument. By default, the limit is the number of 82disks, running one process per disk. If a smaller limit is giv- 83en, the disks are checked round-robin, one file system at a time. 84.It Fl n 85Causes 86.Nm 87to assume no as the answer to all operator questions, except "CONTINUE?". 88.It Fl p 89Enter preen mode. 90In preen mode, 91.Nm 92will check all file systems listed in 93.Pa /etc/fstab 94according to their pass number, and will make minor repairs without 95human intervention. 96Any major problems will cause 97.Nm 98to exit with a non-zero 99.Xr exit 3 100code, so as to alert any invoking program or script that human 101intervention is required. 102.It Fl t Ar fstype 103Invoke 104.Nm 105only for the comma separated list of file system types. If the 106list starts with 107.Dq no 108then invoke 109.Nm 110for the file system types that are not specified in the list. 111.It Fl v 112Print the commands before executing them. 113.It Fl y 114Causes 115.Nm 116to assume yes 117as the answer to all operator questions. 118.It Fl T Ar fstype:fsoptions 119List of comma separated file system specific options for the specified 120file system type, in the same format as 121.Xr mount 8 . 122.El 123.Sh FILES 124.Bl -tag -width /etc/fstab -compact 125.It Pa /etc/fstab 126file system table 127.El 128.Sh SEE ALSO 129.Xr fstab 5 , 130.Xr fsck_ffs 8 , 131.Xr fsck_msdos 8 , 132.Xr mount 8 133