Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 1 | .\" -*- nroff -*- |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 2 | .TH BADBLOCKS 8 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@" |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 3 | .SH NAME |
| 4 | badblocks \- search a device for bad blocks |
| 5 | .SH SYNOPSIS |
| 6 | .B badblocks |
| 7 | [ |
Theodore Ts'o | 981dc56 | 2000-07-06 14:13:29 +0000 | [diff] [blame] | 8 | .B \-svwnf |
Theodore Ts'o | dd018f5 | 2000-02-06 23:57:07 +0000 | [diff] [blame] | 9 | ] |
| 10 | [ |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 11 | .B \-b |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 12 | .I block-size |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 13 | ] |
| 14 | [ |
Theodore Ts'o | dd018f5 | 2000-02-06 23:57:07 +0000 | [diff] [blame] | 15 | .B \-c |
| 16 | .I blocks_at_once |
| 17 | ] |
| 18 | [ |
| 19 | .B \-i |
| 20 | .I input_file |
| 21 | ] |
| 22 | [ |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 23 | .B \-o |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 24 | .I output_file |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 25 | ] |
| 26 | [ |
Theodore Ts'o | dd018f5 | 2000-02-06 23:57:07 +0000 | [diff] [blame] | 27 | .B \-p |
| 28 | .I num_passes |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 29 | ] |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 30 | .I device |
Theodore Ts'o | 35964b5 | 2000-07-06 13:19:43 +0000 | [diff] [blame] | 31 | [ |
Theodore Ts'o | cd130a0 | 2001-05-05 05:43:23 +0000 | [diff] [blame] | 32 | .I last-block |
Theodore Ts'o | 35964b5 | 2000-07-06 13:19:43 +0000 | [diff] [blame] | 33 | ] [ |
| 34 | .I start-block |
| 35 | ] |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 36 | .SH DESCRIPTION |
| 37 | .B badblocks |
| 38 | is used to search for bad blocks on a device (usually a disk partition). |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 39 | .I device |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 40 | is the special file corresponding to the device (e.g |
| 41 | .IR /dev/hdc1 ). |
Theodore Ts'o | cd130a0 | 2001-05-05 05:43:23 +0000 | [diff] [blame] | 42 | .I last-block |
| 43 | is the last block to be checked; if it is not specified, the last block |
| 44 | on the device is used as a default. |
| 45 | .I start-block |
| 46 | is an optional parameter specifying the starting block number |
| 47 | for the test, which allows the testing to start in the middle of the |
| 48 | disk. If it is not specified the first block on the disk is used as a default. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 49 | .SH OPTIONS |
| 50 | .TP |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 51 | .BI \-b " block-size" |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 52 | Specify the size of blocks in bytes. |
| 53 | .TP |
Theodore Ts'o | dd018f5 | 2000-02-06 23:57:07 +0000 | [diff] [blame] | 54 | .BI \-c " number of blocks" |
| 55 | is the number of blocks which are tested at a time. The default is 16. |
Theodore Ts'o | 4d00398 | 2000-04-03 16:01:11 +0000 | [diff] [blame] | 56 | Increasing this number will increase the efficiency of |
| 57 | .B badblocks |
| 58 | but also will increase its memory usage. |
| 59 | .B Badblocks |
| 60 | needs memory proportional to the number of blocks tested at once, in |
| 61 | read-only mode, proportional to twice that number in read-write mode, |
| 62 | and proportional to three times that number in non-destructive read-write |
| 63 | mode. If you set the number-of-blocks parameter to too high a value, |
| 64 | .B badblocks |
| 65 | will exit almost immediately with an out-of-memory error "while allocating |
| 66 | buffers". If you set it too low, however, for a non-destructive-write-mode |
Theodore Ts'o | 7dc4350 | 2000-06-12 16:45:30 +0000 | [diff] [blame] | 67 | test, then it's possble for questionable blocks on an unreliable |
| 68 | hard drive to be hidden by the effects of the hard disk track buffer. |
Theodore Ts'o | dd018f5 | 2000-02-06 23:57:07 +0000 | [diff] [blame] | 69 | .TP |
Theodore Ts'o | 981dc56 | 2000-07-06 14:13:29 +0000 | [diff] [blame] | 70 | .B \-f |
| 71 | Normally, badblocks will refuse to do a read/write or a non-destructive |
| 72 | test on a device which is mounted, since this can cause the system to |
| 73 | potentially crash. This can be overriden using the |
| 74 | .B \- |
| 75 | flag, but this should not be done under normal circumstances. The only time |
| 76 | when this option might be safe is if the /etc/mtab file is incorrect, and |
| 77 | the device really isn't mounted. |
| 78 | .TP |
Theodore Ts'o | dd018f5 | 2000-02-06 23:57:07 +0000 | [diff] [blame] | 79 | .BI \-i " input_file" |
Theodore Ts'o | 4d00398 | 2000-04-03 16:01:11 +0000 | [diff] [blame] | 80 | Read a list of already existing known bad blocks. |
| 81 | .B Badblocks |
| 82 | will skip testing these blocks since they are known to be bad. If |
| 83 | .I input_file |
| 84 | is specified as "-", the list will be read from the standard input. |
| 85 | Blocks listed in this list will be omitted from the list of |
| 86 | .I new |
| 87 | bad blocks produced on the standard output or in the output file. |
| 88 | The |
| 89 | .B \-b |
| 90 | option of |
| 91 | .BR dumpe2fs (8) |
| 92 | can be used to retrieve the list of blocks currently marked bad on |
| 93 | an existing filesystem, in a format suitable for use with this option. |
Theodore Ts'o | dd018f5 | 2000-02-06 23:57:07 +0000 | [diff] [blame] | 94 | .TP |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 95 | .BI \-o " output_file" |
Theodore Ts'o | dd018f5 | 2000-02-06 23:57:07 +0000 | [diff] [blame] | 96 | Write the list of bad blocks to the specified file. Without this option, |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 97 | .B badblocks |
Theodore Ts'o | 92bcc59 | 1998-02-16 22:29:34 +0000 | [diff] [blame] | 98 | displays the list on its standard output. The format of this file is suitable |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 99 | for use by the |
Theodore Ts'o | dd018f5 | 2000-02-06 23:57:07 +0000 | [diff] [blame] | 100 | . |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 101 | .B \-l |
| 102 | option in |
Theodore Ts'o | 92bcc59 | 1998-02-16 22:29:34 +0000 | [diff] [blame] | 103 | .BR e2fsck (8) |
| 104 | or |
| 105 | .BR mke2fs (8). |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 106 | .TP |
Theodore Ts'o | dd018f5 | 2000-02-06 23:57:07 +0000 | [diff] [blame] | 107 | .BI \-p " num_passes" |
Theodore Ts'o | 4d00398 | 2000-04-03 16:01:11 +0000 | [diff] [blame] | 108 | Repeat scanning the disk until there are no new blocks discovered in |
| 109 | num_passes consecutive scans of the disk. |
| 110 | Default is 0, meaning |
| 111 | .B badblocks |
| 112 | will exit after the first pass. |
Theodore Ts'o | dd018f5 | 2000-02-06 23:57:07 +0000 | [diff] [blame] | 113 | .TP |
| 114 | .B \-n |
Theodore Ts'o | a551b78 | 2000-07-13 22:05:31 +0000 | [diff] [blame] | 115 | Use non-destructive read-write mode. By default only a non-destructive |
| 116 | read-only test is done. This option must not be combined with the |
| 117 | .B \-w |
| 118 | option, as they are mutually exclusive. |
Theodore Ts'o | dd018f5 | 2000-02-06 23:57:07 +0000 | [diff] [blame] | 119 | .TP |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 120 | .B \-s |
Theodore Ts'o | ca8abba | 1998-01-19 14:55:24 +0000 | [diff] [blame] | 121 | Show the progress of the scan by writing out the block numbers as they |
| 122 | are checked. |
| 123 | .TP |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 124 | .B \-v |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 125 | Verbose mode. |
| 126 | .TP |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 127 | .B \-w |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 128 | Use write-mode test. With this option, |
| 129 | .B badblocks |
| 130 | scans for bad blocks by writing some patterns (0xaa, 0x55, 0xff, 0x00) on |
Theodore Ts'o | a551b78 | 2000-07-13 22:05:31 +0000 | [diff] [blame] | 131 | every block of the device, reading every block and comparing the contents. |
| 132 | This option may not be compiled with the |
| 133 | .B \-n |
| 134 | option, as they are mutually exclusive. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 135 | .SH WARNING |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 136 | Never use the |
| 137 | .B \-w |
| 138 | option on an device containing an existing file system. |
Theodore Ts'o | 4d00398 | 2000-04-03 16:01:11 +0000 | [diff] [blame] | 139 | This option erases data! If you want to do write-mode testing on |
| 140 | an existing file system, use the |
| 141 | .B \-n |
Theodore Ts'o | a551b78 | 2000-07-13 22:05:31 +0000 | [diff] [blame] | 142 | option instead. It is slower, but it will preserve your data. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 143 | .SH AUTHOR |
| 144 | .B badblocks |
Theodore Ts'o | ffe4cab | 2000-04-03 13:27:41 +0000 | [diff] [blame] | 145 | was written by Remy Card <Remy.Card@linux.org>. Current maintainer is |
| 146 | Theodore Ts'o <tytso@alum.mit.edu>. Non-destructive read/write test |
Theodore Ts'o | 4d00398 | 2000-04-03 16:01:11 +0000 | [diff] [blame] | 147 | implemented by David Beattie <dbeattie@softhome.net>. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 148 | .SH AVAILABILITY |
| 149 | .B badblocks |
Theodore Ts'o | 12da49c | 2001-05-12 15:49:17 +0000 | [diff] [blame] | 150 | is part of the e2fsprogs package and is available from |
Theodore Ts'o | 348e43d | 2001-05-03 14:43:43 +0000 | [diff] [blame] | 151 | http://e2fsprogs.sourceforge.net. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 152 | .SH SEE ALSO |
| 153 | .BR e2fsck (8), |
| 154 | .BR mke2fs (8) |