2 .TH BADBLOCKS 8 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
4 badblocks \- search a device for bad blocks
38 is used to search for bad blocks on a device (usually a disk partition).
40 is the special file corresponding to the device (e.g
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.
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.
53 is going to be fed to the
57 programs, it is important that the block size is properly specified,
58 since the block numbers which are generated is very dependent on the
59 block size in use. For this reason, it is strongly recommended that
64 directly, but rather use the
74 Specify the size of blocks in bytes.
76 .BI \-c " number of blocks"
77 is the number of blocks which are tested at a time. The default is 16.
78 Increasing this number will increase the efficiency of
80 but also will increase its memory usage.
82 needs memory proportional to the number of blocks tested at once, in
83 read-only mode, proportional to twice that number in read-write mode,
84 and proportional to three times that number in non-destructive read-write
85 mode. If you set the number-of-blocks parameter to too high a value,
87 will exit almost immediately with an out-of-memory error "while allocating
88 buffers". If you set it too low, however, for a non-destructive-write-mode
89 test, then it's possble for questionable blocks on an unreliable
90 hard drive to be hidden by the effects of the hard disk track buffer.
93 Normally, badblocks will refuse to do a read/write or a non-destructive
94 test on a device which is mounted, since either can cause the system to
95 potentially crash; even a non-destructive test can damage a mounted
96 filesystem. This can be overriden using the
98 flag, but should almost never be used --- if you think you're smarter
101 program, you almost certainly aren't. The only time when this option
102 might be safe to use is if the /etc/mtab file is incorrect, and the device
103 really isn't mounted.
105 .BI \-i " input_file"
106 Read a list of already existing known bad blocks.
108 will skip testing these blocks since they are known to be bad. If
110 is specified as "-", the list will be read from the standard input.
111 Blocks listed in this list will be omitted from the list of
113 bad blocks produced on the standard output or in the output file.
118 can be used to retrieve the list of blocks currently marked bad on
119 an existing filesystem, in a format suitable for use with this option.
121 .BI \-o " output_file"
122 Write the list of bad blocks to the specified file. Without this option,
124 displays the list on its standard output. The format of this file is suitable
133 .BI \-p " num_passes"
134 Repeat scanning the disk until there are no new blocks discovered in
135 num_passes consecutive scans of the disk.
136 Default is 0, meaning
138 will exit after the first pass.
141 Use non-destructive read-write mode. By default only a non-destructive
142 read-only test is done. This option must not be combined with the
144 option, as they are mutually exclusive.
147 Show the progress of the scan by writing out the block numbers as they
154 Use write-mode test. With this option,
156 scans for bad blocks by writing some patterns (0xaa, 0x55, 0xff, 0x00) on
157 every block of the device, reading every block and comparing the contents.
158 This option may not be combined with the
160 option, as they are mutually exclusive.
164 option on an device containing an existing file system.
165 This option erases data! If you want to do write-mode testing on
166 an existing file system, use the
168 option instead. It is slower, but it will preserve your data.
171 was written by Remy Card <Remy.Card@linux.org>. Current maintainer is
172 Theodore Ts'o <tytso@alum.mit.edu>. Non-destructive read/write test
173 implemented by David Beattie <dbeattie@softhome.net>.
176 is part of the e2fsprogs package and is available from
177 http://e2fsprogs.sourceforge.net.