1.\" $NetBSD: fsck.8,v 1.31 2005/01/19 16:13:57 wiz 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 January 12, 2004 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 dfnPpqvy 39.Op Fl l Ar maxparallel 40.Op Fl T Ar fstype:fsoptions 41.Op Fl t Ar fstype 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. 76Just print the commands without executing them. 77.It Fl f 78Force checking of file systems, even when they are marked clean (for file 79systems that support this), or when they are mounted read-write. 80.It Fl l Ar maxparallel 81Limit the number of parallel checks to the number specified in 82the following argument. 83By default, the limit is the number of disks, running one process per disk. 84If a smaller limit is given, the disks are checked round-robin, 85one file system at a time. 86.It Fl n 87Causes 88.Nm 89to assume no as the answer to all operator questions, except "CONTINUE?". 90.It Fl P 91Display a progress meter for each file system check. 92This option also disables parallel checking. 93Note that progress meters are not supported by all file system types. 94.It Fl p 95Enter preen mode. 96In preen mode, 97.Nm 98will check all file systems listed in 99.Pa /etc/fstab 100according to their pass number, and will make minor repairs without 101human intervention. 102Any major problems will cause 103.Nm 104to exit with a non-zero 105.Xr exit 3 106code, so as to alert any invoking program or script that human 107intervention is required. 108.It Fl q 109Quiet mode, do not output any messages for clean filesystems. 110.It Fl T Ar fstype:fsoptions 111List of comma separated file system specific options for the specified 112file system type, in the same format as 113.Xr mount 8 . 114.It Fl t Ar fstype 115Invoke 116.Nm 117only for the comma separated list of file system types. 118If the list starts with 119.Dq no 120then invoke 121.Nm 122for the file system types that are not specified in the list. 123.It Fl v 124Print the commands before executing them. 125.It Fl y 126Causes 127.Nm 128to assume yes 129as the answer to all operator questions. 130.El 131.Sh FILES 132.Bl -tag -width /etc/fstab -compact 133.It Pa /etc/fstab 134file system table 135.El 136.Sh SEE ALSO 137.Xr fstab 5 , 138.Xr fsck_ffs 8 , 139.Xr fsck_msdos 8 , 140.Xr mount 8 141