Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 1 | .\" -*- nroff -*- |
Theodore Ts'o | a418d3a | 1997-04-26 14:00:26 +0000 | [diff] [blame] | 2 | .\" Copyright 1993, 1994, 1995 by Theodore Ts'o. All Rights Reserved. |
| 3 | .\" This file may be copied under the terms of the GNU Public License. |
| 4 | .\" |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 5 | .TH FSCK 8 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@" |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 6 | .SH NAME |
| 7 | fsck \- check and repair a Linux file system |
| 8 | .SH SYNOPSIS |
| 9 | .B fsck |
| 10 | [ |
Theodore Ts'o | 7f88b04 | 1997-04-26 14:48:50 +0000 | [diff] [blame] | 11 | .B \-AVRTNP |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 12 | ] |
| 13 | [ |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 14 | .B \-s |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 15 | ] |
| 16 | [ |
| 17 | .B \-t |
| 18 | .I fstype |
| 19 | ] |
| 20 | [ |
| 21 | .B fs-options |
| 22 | ] |
| 23 | .I filesys [ ... ] |
| 24 | .SH DESCRIPTION |
| 25 | .B fsck |
| 26 | is used to check and optionally repair a Linux file system. |
| 27 | .I filesys |
| 28 | is either the device name (e.g. /dev/hda1, /dev/sdb2) or the mount point |
Theodore Ts'o | 583ccdc | 1997-05-09 03:06:31 +0000 | [diff] [blame] | 29 | (e.g. /, /usr, /home) for the file system. If this invocation of |
| 30 | .B fsck |
| 31 | has several filesystems on different physical disk drives to check, then |
| 32 | .B fsck |
| 33 | will try to run them in parallel. This reduces the total amount time it |
| 34 | takes to check all of the filesystems, since |
| 35 | .B fsck |
| 36 | takes advantage of the parallelism of multiple disk spindles. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 37 | .PP |
| 38 | The exit code returned by |
| 39 | .B fsck |
| 40 | is the sum of the following conditions: |
| 41 | .br |
| 42 | \ 0\ \-\ No errors |
| 43 | .br |
| 44 | \ 1\ \-\ File system errors corrected |
| 45 | .br |
| 46 | \ 2\ \-\ System should be rebooted |
| 47 | .br |
| 48 | \ 4\ \-\ File system errors left uncorrected |
| 49 | .br |
| 50 | \ 8\ \-\ Operational error |
| 51 | .br |
| 52 | \ 16\ \-\ Usage or syntax error |
| 53 | .br |
| 54 | \ 128\ \-\ Shared library error |
| 55 | .br |
| 56 | The exit code returned when all file systems are checked using the |
| 57 | .B -A |
| 58 | option is the bit-wise OR of the exit codes for each |
| 59 | file system that is checked. |
| 60 | .PP |
| 61 | In actuality, |
| 62 | .B fsck |
| 63 | is simply a front-end for the various file system checkers |
| 64 | (\fBfsck\fR.\fIfstype\fR) available under Linux. The file |
| 65 | system-specific checker is searched for in /sbin first, then in /etc/fs |
| 66 | and /etc, and finally in the directories listed in the PATH environment |
| 67 | variable. Please see the file system-specific checker manual pages for |
| 68 | further details. |
| 69 | .SH OPTIONS |
| 70 | .TP |
| 71 | .B -A |
| 72 | Walk through the |
| 73 | .I /etc/fstab |
| 74 | file and try to check all file systems in one run. This option is |
| 75 | typically used from the |
| 76 | .I /etc/rc |
| 77 | system initalization file, instead of multiple commands for checking |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 78 | a single file system. |
| 79 | .TP |
| 80 | .B -R |
| 81 | When checking all file systems with the |
| 82 | .B \-A |
| 83 | flag, skip the root file system (in case it's already mounted read-write). |
| 84 | .TP |
| 85 | .B -T |
| 86 | Don't show the title on startup. |
| 87 | .TP |
| 88 | .B -N |
| 89 | Don't execute, just show what would be done. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 90 | .TP |
Theodore Ts'o | 7f88b04 | 1997-04-26 14:48:50 +0000 | [diff] [blame] | 91 | .B -P |
| 92 | When the |
| 93 | .B -A |
| 94 | flag is set, check the root filesystem in parallel with the other filesystems. |
| 95 | This is not the safest thing in the world to do, |
Theodore Ts'o | 583ccdc | 1997-05-09 03:06:31 +0000 | [diff] [blame] | 96 | since if the root filesystem is in doubt things like the |
| 97 | .BR e2fsck (8) |
| 98 | executable might be corrupted! This option is mainly provided |
Theodore Ts'o | 7f88b04 | 1997-04-26 14:48:50 +0000 | [diff] [blame] | 99 | for those sysadmins who don't want to repartition the root |
| 100 | filesystem to be small and compact (which is really the right solution). |
| 101 | .TP |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 102 | .B -s |
Theodore Ts'o | 583ccdc | 1997-05-09 03:06:31 +0000 | [diff] [blame] | 103 | Serialize |
| 104 | .B fsck |
| 105 | operations. This is a good idea if you checking multiple |
| 106 | filesystems and the checkers are in an interactive mode. (Note: |
| 107 | .BR e2fsck (8) |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 108 | runs in an interactive mode by default. To make |
Theodore Ts'o | 583ccdc | 1997-05-09 03:06:31 +0000 | [diff] [blame] | 109 | .BR e2fsck (8) |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 110 | run in a non-interactive mode, you must either specify the |
| 111 | .B -p |
| 112 | or |
| 113 | .B -a |
| 114 | option, if you wish for errors to be corrected automatically, or |
| 115 | the |
| 116 | .B -n |
| 117 | option if you do not.) |
| 118 | .TP |
| 119 | .B -V |
| 120 | Produce verbose output, including all file system-specific commands |
| 121 | that are executed. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 122 | .TP |
| 123 | .BI -t \ fstype |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 124 | Specifies the type of file system to be checked. When the |
| 125 | .B \-A |
| 126 | flag is specified, only filesystems that match |
| 127 | .I fstype |
| 128 | are checked. If |
| 129 | .I fstype |
| 130 | is prefixed with |
| 131 | .B no |
Theodore Ts'o | 583ccdc | 1997-05-09 03:06:31 +0000 | [diff] [blame] | 132 | then only filesystems whose type does not match |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 133 | .I fstype |
| 134 | are checked. |
| 135 | .sp |
| 136 | Normally, the filesystem type is deduced by searching for |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 137 | .I filesys |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 138 | in the |
| 139 | .I /etc/fstab |
| 140 | file and using the corresponding entry. |
| 141 | If the type can not be deduced, |
| 142 | .B fsck |
| 143 | will use the type specified by the |
| 144 | .B \-t |
| 145 | option if it specifies a unique filesystem type. If this type is not |
Theodore Ts'o | 583ccdc | 1997-05-09 03:06:31 +0000 | [diff] [blame] | 146 | available, then the default file system type (currently ext2) is used. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 147 | .TP |
| 148 | .B fs-options |
| 149 | Any options which are not understood by |
| 150 | .BR fsck , |
| 151 | or which follow the |
| 152 | .B -- |
| 153 | option are treated as file system-specific options to be passed to the |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 154 | file system-specific checker. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 155 | .PP |
| 156 | Currently, standardized file system-specific options are somewhat in |
| 157 | flux. Although not guaranteed, the following options are supported |
Theodore Ts'o | 583ccdc | 1997-05-09 03:06:31 +0000 | [diff] [blame] | 158 | by most file system checkers: |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 159 | .TP |
| 160 | .B -a |
| 161 | Automatically repair the file system without any questions (use |
| 162 | this option with caution). Note that |
Theodore Ts'o | 583ccdc | 1997-05-09 03:06:31 +0000 | [diff] [blame] | 163 | .BR e2fsck (8) |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 164 | supports |
| 165 | .B -a |
Theodore Ts'o | 583ccdc | 1997-05-09 03:06:31 +0000 | [diff] [blame] | 166 | for backwards compatibility only. This option is mapped to |
| 167 | .BR e2fsck 's |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 168 | .B -p |
| 169 | option which is safe to use, unlike the |
| 170 | .B -a |
| 171 | option that most file system checkers support. |
| 172 | .TP |
| 173 | .B -r |
| 174 | Interactively repair the filesystem (ask for confirmations). Note: It |
| 175 | is generally a bad idea to use this option if multiple fsck's are being |
| 176 | run in parallel. Also note that this is |
Theodore Ts'o | 583ccdc | 1997-05-09 03:06:31 +0000 | [diff] [blame] | 177 | .BR e2fsck 's |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 178 | default behavior; it supports this option for backwards compatibility |
| 179 | reasons only. |
| 180 | .SH AUTHOR |
| 181 | Theodore Ts'o (tytso@mit.edu) |
| 182 | .PP |
| 183 | The manual page was shamelessly adapted from David Engel and Fred van |
Theodore Ts'o | 583ccdc | 1997-05-09 03:06:31 +0000 | [diff] [blame] | 184 | Kempen's generic |
| 185 | .B fsck |
| 186 | front end program, which was in turn shamelessly |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 187 | adapted from Remy Card's version for the ext2 file system. |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 188 | .SH FILES |
| 189 | .IR /etc/fstab . |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 190 | .SH SEE ALSO |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 191 | .BR fstab (5), |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 192 | .BR mkfs (8), |
| 193 | .BR fsck.minix (8), |
| 194 | .BR fsck.ext2 (8) |
| 195 | or |
| 196 | .BR e2fsck (8), |
| 197 | .BR fsck.xiafs (8). |