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.
52 Specify the size of blocks in bytes.
54 .BI \-c " number of blocks"
55 is the number of blocks which are tested at a time. The default is 16.
56 Increasing this number will increase the efficiency of
58 but also will increase its memory usage.
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,
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
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.
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
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.
80 Read a list of already existing known bad blocks.
82 will skip testing these blocks since they are known to be bad. If
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
87 bad blocks produced on the standard output or in the output file.
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.
95 .BI \-o " output_file"
96 Write the list of bad blocks to the specified file. Without this option,
98 displays the list on its standard output. The format of this file is suitable
107 .BI \-p " num_passes"
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
112 will exit after the first pass.
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
118 option, as they are mutually exclusive.
121 Show the progress of the scan by writing out the block numbers as they
128 Use write-mode test. With this option,
130 scans for bad blocks by writing some patterns (0xaa, 0x55, 0xff, 0x00) on
131 every block of the device, reading every block and comparing the contents.
132 This option may not be compiled with the
134 option, as they are mutually exclusive.
138 option on an device containing an existing file system.
139 This option erases data! If you want to do write-mode testing on
140 an existing file system, use the
142 option instead. It is slower, but it will preserve your data.
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
147 implemented by David Beattie <dbeattie@softhome.net>.
150 is part of the e2fsprogs package and is available from
151 http://e2fsprogs.sourceforge.net.