1.\" $OpenBSD: fsck.8,v 1.34 2014/07/13 17:28:13 jmc Exp $ 2.\" $NetBSD: fsck.8,v 1.14 1996/10/03 20:08:29 christos Exp $ 3.\" 4.\" Copyright (c) 1996 Christos Zoulas. All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 3. All advertising materials mentioning features or use of this software 15.\" must display the following acknowledgement: 16.\" This product includes software developed by Christos Zoulas. 17.\" 4. The name of the author may not be used to endorse or promote products 18.\" derived from this software without specific prior written permission. 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 21.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 22.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 23.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 24.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 25.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 29.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30.\" 31.Dd $Mdocdate: July 13 2014 $ 32.Dt FSCK 8 33.Os 34.Sh NAME 35.Nm fsck 36.Nd file system consistency check and interactive repair 37.Sh SYNOPSIS 38.Nm fsck 39.Bk -words 40.Op Fl dfNnpvy 41.Op Fl b Ar block# 42.Op Fl l Ar maxparallel 43.Op Fl T Ar fstype : Ns Ar fsoptions 44.Op Fl t Ar fstype 45.Op Ar special | node ... 46.Ek 47.Sh DESCRIPTION 48The 49.Nm 50command invokes file-system-specific programs to check the 51special devices listed in the 52.Xr fstab 5 53file or on the command line for consistency. 54.Pp 55It is normally used in the script 56.Xr rc 8 57during automatic reboot. 58If no file systems are specified, 59.Nm 60reads the file 61.Xr fstab 5 62to determine which file systems to check and in what order. 63Only partitions in fstab that are mounted 64.Dq rw 65or 66.Dq ro 67and that have non-zero pass numbers are checked. 68File systems with pass number 1 (normally just the root file system) are 69checked one at a time. 70When pass 1 completes, all remaining file systems are checked, with one 71process spawned per disk drive. 72The disk drive containing each file system is inferred from the longest 73prefix of the device name that ends in a digit; the remaining characters 74are assumed to be the partition designator. 75By default, file systems which are already mounted read/write are not 76checked. 77.Pp 78The options are as follows: 79.Bl -tag -width Ds 80.It Fl b Ar block# 81Causes 82.Nm 83to use the specified block as the location of the superblock. 84Block 32 is usually an alternate super block. 85This option is only valid for filesystems that support backup superblocks 86(ffs and ext2fs). 87.It Fl d 88Debugging mode. 89Just print the commands without executing them. 90Available only if 91.Nm 92is compiled to support it. 93.It Fl f 94Force checking of file systems, even when they are marked clean (for file systems 95that support this). 96.It Fl l Ar maxparallel 97Limit the number of parallel checks to 98.Ar maxparallel . 99By default, the limit is the number of 100disks, running one process per disk. 101If a smaller limit is given, 102the disks are checked round-robin, one file system at a time. 103.It Fl N 104When using 105.Xr fstab 5 , 106only check filesystems that have the 107.Dq net 108mount option set. 109By default file systems with this option are ignored. 110.It Fl n 111Assume a 112.Dq no 113response to all questions asked by 114.Nm 115except for 116.Dq CONTINUE? , 117which is assumed to be affirmative. 118File systems will not be opened for writing. 119This is the default for file systems to be checked that are 120concurrently mounted writable. 121.It Fl p 122Enter preen mode: 123.Nm 124will check all file systems listed in 125.Xr fstab 5 126according to their pass number, 127or any special devices listed on the command line, 128and will make minor repairs without 129human intervention. 130Any major problems will cause 131.Nm 132to exit with a non-zero exit code, 133so as to alert any invoking program or script 134that human intervention is required. 135.It Fl T Ar fstype : Ns Ar fsoptions 136List of comma separated file system specific options for the specified 137file system type, in the same format as 138.Xr mount 8 . 139.It Fl t Ar fstype 140Invoke 141.Nm 142only for the comma separated list of file system types. 143If the list starts with 144.Dq no , 145invoke 146.Nm 147only in the file system types that are 148.Em not 149specified in 150the list. 151.It Fl v 152Print the commands before executing them. 153.It Fl y 154Cause 155.Nm 156to assume 157.Dq yes 158as the answer to all operator questions. 159.El 160.Pp 161If neither of the 162.Fl y 163or 164.Fl n 165options are specified, the user may force 166.Nm 167to assume an answer of 168.Dq yes 169to all the remaining questions by replying to a question with a value of 170.Dq F . 171.Sh FILES 172.Bl -tag -width /etc/fstab -compact 173.It Pa /etc/fstab 174file system table 175.El 176.Sh SEE ALSO 177.Xr fs 5 , 178.Xr fstab 5 , 179.Xr fsck_ext2fs 8 , 180.Xr fsck_ffs 8 , 181.Xr fsck_msdos 8 , 182.Xr fsdb 8 , 183.Xr growfs 8 , 184.Xr mount 8 , 185.Xr newfs 8 , 186.Xr rc 8 , 187.Xr scan_ffs 8 188