2 .TH BADBLOCKS 8 "July 2003" "E2fsprogs version 1.34"
4 badblocks \- search a device for bad blocks
42 is used to search for bad blocks on a device (usually a disk partition).
44 is the special file corresponding to the device (e.g
47 is the last block to be checked; if it is not specified, the last block
48 on the device is used as a default.
50 is an optional parameter specifying the starting block number
51 for the test, which allows the testing to start in the middle of the
52 disk. If it is not specified the first block on the disk is used as a default.
57 is going to be fed to the
61 programs, it is important that the block size is properly specified,
62 since the block numbers which are generated are very dependent on the
63 block size in use. For this reason, it is strongly recommended that
68 directly, but rather use the
78 Specify the size of blocks in bytes.
80 .BI \-c " number of blocks"
81 is the number of blocks which are tested at a time. The default is 16.
82 Increasing this number will increase the efficiency of
84 but also will increase its memory usage.
86 needs memory proportional to the number of blocks tested at once, in
87 read-only mode, proportional to twice that number in read-write mode,
88 and proportional to three times that number in non-destructive read-write
89 mode. If you set the number-of-blocks parameter to too high a value,
91 will exit almost immediately with an out-of-memory error "while allocating
92 buffers". If you set it too low, however, for a non-destructive-write-mode
93 test, then it's possble for questionable blocks on an unreliable
94 hard drive to be hidden by the effects of the hard disk track buffer.
97 Normally, badblocks will refuse to do a read/write or a non-destructive
98 test on a device which is mounted, since either can cause the system to
99 potentially crash and/or damage the filesystem even if it is mounted
100 read-only. This can be overriden using the
102 flag, but should almost never be used --- if you think you're smarter
105 program, you almost certainly aren't. The only time when this option
106 might be safe to use is if the /etc/mtab file is incorrect, and the device
107 really isn't mounted.
109 .BI \-i " input_file"
110 Read a list of already existing known bad blocks.
112 will skip testing these blocks since they are known to be bad. If
114 is specified as "-", the list will be read from the standard input.
115 Blocks listed in this list will be omitted from the list of
117 bad blocks produced on the standard output or in the output file.
122 can be used to retrieve the list of blocks currently marked bad on
123 an existing filesystem, in a format suitable for use with this option.
125 .BI \-o " output_file"
126 Write the list of bad blocks to the specified file. Without this option,
128 displays the list on its standard output. The format of this file is suitable
137 .BI \-p " num_passes"
138 Repeat scanning the disk until there are no new blocks discovered in
139 num_passes consecutive scans of the disk.
140 Default is 0, meaning
142 will exit after the first pass.
144 .BI \-t " test_pattern"
145 Specify a test pattern to be read (and written) to disk blocks. The
147 may either be a numeric value between 0 and ULONG_MAX-1 inclusive, or the word
148 "random", which specifies that the block should be filled with a random
150 For read/write (\fB-w\fR) and non-destructive (\fB-n\fR) modes,
151 one or more test patterns may be specified by specifiying the
153 option for each test pattern desired. For
154 read-only mode only a single pattern may be specified and it may not be
155 "random". Read-only testing with a pattern assumes that the
156 specified pattern has previously been written to the disk - if not, large
157 numbers of blocks will fail verification.
159 are specified then all blocks will be tested with an one pattern
160 before proceeding to the next pattern.
163 Use non-destructive read-write mode. By default only a non-destructive
164 read-only test is done. This option must not be combined with the
166 option, as they are mutually exclusive.
169 Show the progress of the scan by writing out the block numbers as they
176 Use write-mode test. With this option,
178 scans for bad blocks by writing some patterns (0xaa, 0x55, 0xff, 0x00) on
179 every block of the device, reading every block and comparing the contents.
180 This option may not be combined with the
182 option, as they are mutually exclusive.
186 option on an device containing an existing file system.
187 This option erases data! If you want to do write-mode testing on
188 an existing file system, use the
190 option instead. It is slower, but it will preserve your data.
193 was written by Remy Card <Remy.Card@linux.org>. Current maintainer is
194 Theodore Ts'o <tytso@alum.mit.edu>. Non-destructive read/write test
195 implemented by David Beattie <dbeattie@softhome.net>.
198 is part of the e2fsprogs package and is available from
199 http://e2fsprogs.sourceforge.net.