Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 1 | .\" -*- nroff -*- |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 2 | .\" Copyright 1993, 1994, 1995 by Theodore Ts'o. All Rights Reserved. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 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 E2FSCK 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 | e2fsck \- check a Linux second extended file system |
| 8 | .SH SYNOPSIS |
| 9 | .B e2fsck |
| 10 | [ |
Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 11 | .B \-pacnyrdfvstFSV |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 12 | ] |
| 13 | [ |
| 14 | .B \-b |
| 15 | .I superblock |
| 16 | ] |
| 17 | [ |
| 18 | .B \-B |
| 19 | .I blocksize |
| 20 | ] |
| 21 | [ |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 22 | .BR \-l | \-L |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 23 | .I bad_blocks_file |
| 24 | ] |
Theodore Ts'o | efac9a1 | 1998-05-07 05:02:00 +0000 | [diff] [blame] | 25 | [ |
| 26 | .B \-C |
| 27 | .I fd |
| 28 | ] |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 29 | .I device |
| 30 | .SH DESCRIPTION |
| 31 | .B e2fsck |
Theodore Ts'o | 3b5386d | 2000-08-14 14:25:19 +0000 | [diff] [blame] | 32 | is used to check a Linux second extended file system (e2fs). E2fsck also |
| 33 | supports ext2 filesystems countaining a journal, which are |
| 34 | also sometimes known as ext3 filesystems. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 35 | .TP |
| 36 | .I device |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 37 | is the special file corresponding to the device (e.g |
| 38 | .IR /dev/hdc1 ). |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 39 | .SH OPTIONS |
| 40 | .TP |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 41 | .B \-a |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 42 | This option does the same thing as the |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 43 | .B \-p |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 44 | option. It is provided for backwards compatibility only; it is |
| 45 | suggested that people use |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 46 | .B \-p |
Theodore Ts'o | 583ccdc | 1997-05-09 03:06:31 +0000 | [diff] [blame] | 47 | option whenever possible. |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 48 | .TP |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 49 | .BI \-b " superblock" |
Theodore Ts'o | 24dd402 | 1998-02-01 00:16:40 +0000 | [diff] [blame] | 50 | Instead of using the normal superblock, use an alternative superblock |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 51 | specified by |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 52 | .IR superblock . |
| 53 | This option is normally used when the primary superblock has been |
Theodore Ts'o | a1ccadb | 1999-11-23 13:57:16 +0000 | [diff] [blame] | 54 | corrupted. The location of the backup superblock is dependent on the |
| 55 | filesystem's blocksize. For filesystems with 1k blocksizes, a backup |
| 56 | superblock can be found at block 8193; for filesystems with 2k |
| 57 | blocksizes, at block 16384; and for 4k blocksizes, at block 32768. If |
| 58 | an alternative superblock is specified and |
Theodore Ts'o | 24dd402 | 1998-02-01 00:16:40 +0000 | [diff] [blame] | 59 | the filesystem is not opened read-only, e2fsck will make sure that the |
| 60 | primary superblock is updated appropriately upon completion of the |
| 61 | filesystem check. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 62 | .TP |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 63 | .BI \-B " blocksize" |
Theodore Ts'o | 583ccdc | 1997-05-09 03:06:31 +0000 | [diff] [blame] | 64 | Normally, |
| 65 | .B e2fsck |
| 66 | will search for the superblock at various different |
| 67 | block sizes in an attempt to find the appropriate block size. |
| 68 | This search can be fooled in some cases. This option forces |
| 69 | .B e2fsck |
| 70 | to only try locating the superblock at a particular blocksize. |
| 71 | If the superblock is not found, |
| 72 | .B e2fsck |
| 73 | will terminate with a fatal error. |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 74 | .TP |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 75 | .B \-c |
Theodore Ts'o | 583ccdc | 1997-05-09 03:06:31 +0000 | [diff] [blame] | 76 | This option causes |
| 77 | .B e2fsck |
| 78 | to run the |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 79 | .BR badblocks (8) |
Theodore Ts'o | 583ccdc | 1997-05-09 03:06:31 +0000 | [diff] [blame] | 80 | program to find any blocks which are bad on the filesystem, |
| 81 | and then marks them as bad by adding them to the bad block inode. |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 82 | .TP |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 83 | .B \-C |
Theodore Ts'o | efac9a1 | 1998-05-07 05:02:00 +0000 | [diff] [blame] | 84 | This option causes |
| 85 | .B e2fsck |
| 86 | to write completion information to the specified file descriptor |
| 87 | so that the progress of the filesystem |
Theodore Ts'o | 5596def | 1999-07-19 15:27:37 +0000 | [diff] [blame] | 88 | check can be monitored. This option is typically used by programs |
| 89 | which are running |
| 90 | .BR e2fsck . |
| 91 | If the file descriptor specified is 0, |
Theodore Ts'o | efac9a1 | 1998-05-07 05:02:00 +0000 | [diff] [blame] | 92 | .B e2fsck |
Theodore Ts'o | 5596def | 1999-07-19 15:27:37 +0000 | [diff] [blame] | 93 | will print a completion bar as it goes about its business. This requires |
| 94 | that e2fsck is running on a video console or terminal. |
Theodore Ts'o | efac9a1 | 1998-05-07 05:02:00 +0000 | [diff] [blame] | 95 | .TP |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 96 | .B \-d |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 97 | Print debugging output (useless unless you are debugging |
Theodore Ts'o | 583ccdc | 1997-05-09 03:06:31 +0000 | [diff] [blame] | 98 | .BR e2fsck ). |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 99 | .TP |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 100 | .B \-f |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 101 | Force checking even if the file system seems clean. |
| 102 | .TP |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 103 | .B \-F |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 104 | Flush the filesystem device's buffer caches before beginning. Only |
Theodore Ts'o | 583ccdc | 1997-05-09 03:06:31 +0000 | [diff] [blame] | 105 | really useful for doing |
| 106 | .B e2fsck |
| 107 | time trials. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 108 | .TP |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 109 | .BI \-l " filename" |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 110 | Add the blocks listed in the file specified by |
| 111 | .I filename |
Theodore Ts'o | 4313932 | 1998-02-16 22:34:46 +0000 | [diff] [blame] | 112 | to the list of bad blocks. The format of this file is the same as the |
| 113 | one generated by the |
| 114 | .BR badblocks (8) |
| 115 | program. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 116 | .TP |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 117 | .BI \-L " filename" |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 118 | Set the bad blocks list to be the list of blocks specified by |
| 119 | .IR filename . |
| 120 | (This option is the same as the |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 121 | .B \-l |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 122 | option, except the bad blocks list is cleared before the blocks listed |
| 123 | in the file are added to the bad blocks list.) |
| 124 | .TP |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 125 | .B \-n |
| 126 | Open the filesystem read-only, and assume an answer of `no' to all |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 127 | questions. Allows |
| 128 | .B e2fsck |
| 129 | to be used non-interactively. (Note: if the |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 130 | .BR \-c , |
| 131 | .BR \-l , |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 132 | or |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 133 | .B \-L |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 134 | options are specified in addition to the |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 135 | .B \-n |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 136 | option, then the filesystem will be opened read-write, to permit the |
| 137 | bad-blocks list to be updated. However, no other changes will be made |
| 138 | to the filesystem.) |
| 139 | .TP |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 140 | .B \-p |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 141 | Automatically repair ("preen") the file system without any questions. |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 142 | .TP |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 143 | .B \-r |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 144 | This option does nothing at all; it is provided only for backwards |
| 145 | compatibility. |
Theodore Ts'o | 583ccdc | 1997-05-09 03:06:31 +0000 | [diff] [blame] | 146 | .TP |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 147 | .B \-s |
Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 148 | This option will byte-swap the filesystem so that it is using the normalized, |
| 149 | standard byte-order (which is i386 or little endian). If the filesystem is |
Theodore Ts'o | 583ccdc | 1997-05-09 03:06:31 +0000 | [diff] [blame] | 150 | already in the standard byte-order, |
| 151 | .B e2fsck |
| 152 | will take no action. |
Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 153 | .TP |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 154 | .B \-S |
Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 155 | This option will byte-swap the filesystem, regardless of its current |
| 156 | byte-order. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 157 | .TP |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 158 | .B \-t |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 159 | Print timing statistics for |
| 160 | .BR e2fsck . |
| 161 | If this option is used twice, additional timing statistics are printed |
| 162 | on a pass by pass basis. |
| 163 | .TP |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 164 | .B \-v |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 165 | Verbose mode. |
| 166 | .TP |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 167 | .B \-V |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 168 | Print version information and exit. |
| 169 | .TP |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 170 | .B \-y |
| 171 | Assume an answer of `yes' to all questions; allows |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 172 | .B e2fsck |
| 173 | to be used non-interactively. |
| 174 | .SH EXIT CODE |
| 175 | The exit code returned by |
| 176 | .B e2fsck |
| 177 | is the sum of the following conditions: |
| 178 | .br |
| 179 | \ 0\ \-\ No errors |
| 180 | .br |
| 181 | \ 1\ \-\ File system errors corrected |
| 182 | .br |
| 183 | \ 2\ \-\ File system errors corrected, system should |
| 184 | .br |
| 185 | \ \ \ \ be rebooted if file system was mounted |
| 186 | .br |
| 187 | \ 4\ \-\ File system errors left uncorrected |
| 188 | .br |
| 189 | \ 8\ \-\ Operational error |
| 190 | .br |
| 191 | \ 16\ \-\ Usage or syntax error |
| 192 | .br |
| 193 | \ 128\ \-\ Shared library error |
| 194 | .br |
Theodore Ts'o | 5596def | 1999-07-19 15:27:37 +0000 | [diff] [blame] | 195 | .SH SIGNALS |
| 196 | The following signals have the following effect when sent to |
| 197 | .BR e2fsck . |
| 198 | .TP |
| 199 | .B SIGUSR1 |
| 200 | This signal causes |
| 201 | .B e2fsck |
| 202 | to start displaying a completion bar. (See discussion of the |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 203 | .B \-C |
Theodore Ts'o | 5596def | 1999-07-19 15:27:37 +0000 | [diff] [blame] | 204 | option.) |
| 205 | .TP |
| 206 | .B SIGUSR2 |
| 207 | This signal causes |
| 208 | .B e2fsck |
| 209 | to stop displaying a completion bar. |
Theodore Ts'o | 5c57647 | 1997-04-29 15:29:49 +0000 | [diff] [blame] | 210 | .SH REPORTING BUGS |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 211 | Almost any piece of software will have bugs. If you manage to find a |
| 212 | filesystem which causes |
| 213 | .B e2fsck |
| 214 | to crash, or which |
| 215 | .B e2fsck |
| 216 | is unable to repair, please report it to the author. |
| 217 | .PP |
| 218 | Please include as much information as possible in your bug report. |
| 219 | Ideally, include a complete transcript of the |
| 220 | .B e2fsck |
| 221 | run, so I can see exactly what error messages are displayed. If you |
| 222 | have a writeable filesystem where the transcript can be stored, the |
| 223 | .BR script (1) |
| 224 | program is a handy way to save the output of |
Theodore Ts'o | 583ccdc | 1997-05-09 03:06:31 +0000 | [diff] [blame] | 225 | .B e2fsck |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 226 | to a file. |
| 227 | .PP |
| 228 | It is also useful to send the output of |
| 229 | .BR dumpe2fs (8). |
| 230 | If a specific inode or inodes seems to be giving |
| 231 | .B e2fsck |
| 232 | trouble, try running the |
| 233 | .BR debugfs (8) |
| 234 | command and send the output of the |
Theodore Ts'o | 583ccdc | 1997-05-09 03:06:31 +0000 | [diff] [blame] | 235 | .BR stat (1u) |
| 236 | command run on the relevant inode(s). If the inode is a directory, the |
| 237 | .B debugfs |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 238 | .I dump |
| 239 | command will allow you to extract the contents of the directory inode, |
| 240 | which can sent to me after being first run through |
| 241 | .BR uuencode (1). |
| 242 | .PP |
| 243 | Always include the full version string which |
| 244 | .B e2fsck |
| 245 | displays when it is run, so I know which version you are running. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 246 | .SH AUTHOR |
| 247 | This version of |
| 248 | .B e2fsck |
Theodore Ts'o | 583ccdc | 1997-05-09 03:06:31 +0000 | [diff] [blame] | 249 | was written by Theodore Ts'o <tytso@mit.edu>. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 250 | .SH SEE ALSO |
| 251 | .BR mke2fs (8), |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 252 | .BR tune2fs (8), |
| 253 | .BR dumpe2fs (8), |
| 254 | .BR debugfs (8) |