2 .TH BADBLOCKS 8 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
4 badblocks \- search a device for bad blocks
46 is used to search for bad blocks on a device (usually a disk partition).
48 is the special file corresponding to the device (e.g
51 is the last block to be checked; if it is not specified, the last block
52 on the device is used as a default.
54 is an optional parameter specifying the starting block number
55 for the test, which allows the testing to start in the middle of the
56 disk. If it is not specified the first block on the disk is used as a default.
61 is going to be fed to the
65 programs, it is important that the block size is properly specified,
66 since the block numbers which are generated are very dependent on the
67 block size in use by the filesystem.
68 For this reason, it is strongly recommended that
73 directly, but rather use the
83 Specify the size of blocks in bytes. The default is 1024.
85 .BI \-c " number of blocks"
86 is the number of blocks which are tested at a time. The default is 64.
88 .BI \-e " max bad block count"
89 Specify a maximum number of bad blocks before aborting the test. The
90 default is 0, meaning the test will continue until the end of the test
94 Normally, badblocks will refuse to do a read/write or a non-destructive
95 test on a device which is mounted, since either can cause the system to
96 potentially crash and/or damage the filesystem even if it is mounted
97 read-only. This can be overridden using the
99 flag, but should almost never be used --- if you think you're smarter
102 program, you almost certainly aren't. The only time when this option
103 might be safe to use is if the /etc/mtab file is incorrect, and the device
104 really isn't mounted.
106 .BI \-i " input_file"
107 Read a list of already existing known bad blocks.
109 will skip testing these blocks since they are known to be bad. If
111 is specified as "-", the list will be read from the standard input.
112 Blocks listed in this list will be omitted from the list of
114 bad blocks produced on the standard output or in the output file.
119 can be used to retrieve the list of blocks currently marked bad on
120 an existing filesystem, in a format suitable for use with this option.
122 .BI \-o " output_file"
123 Write the list of bad blocks to the specified file. Without this option,
125 displays the list on its standard output. The format of this file is suitable
134 .BI \-p " num_passes"
135 Repeat scanning the disk until there are no new blocks discovered in
136 num_passes consecutive scans of the disk.
137 Default is 0, meaning
139 will exit after the first pass.
141 .BI \-t " test_pattern"
142 Specify a test pattern to be read (and written) to disk blocks. The
144 may either be a numeric value between 0 and ULONG_MAX-1 inclusive, or the word
145 "random", which specifies that the block should be filled with a random
147 For read/write (\fB-w\fR) and non-destructive (\fB-n\fR) modes,
148 one or more test patterns may be specified by specifying the
150 option for each test pattern desired. For
151 read-only mode only a single pattern may be specified and it may not be
152 "random". Read-only testing with a pattern assumes that the
153 specified pattern has previously been written to the disk - if not, large
154 numbers of blocks will fail verification.
156 are specified then all blocks will be tested with one pattern
157 before proceeding to the next pattern.
160 Use non-destructive read-write mode. By default only a non-destructive
161 read-only test is done. This option must not be combined with the
163 option, as they are mutually exclusive.
166 Show the progress of the scan by writing out the block numbers as they
173 Use write-mode test. With this option,
175 scans for bad blocks by writing some patterns (0xaa, 0x55, 0xff, 0x00) on
176 every block of the device, reading every block and comparing the contents.
177 This option may not be combined with the
179 option, as they are mutually exclusive.
182 Internal flag only to be used by
186 It bypasses the exclusive mode in-use device safety check.
190 option on a device containing an existing file system.
191 This option erases data! If you want to do write-mode testing on
192 an existing file system, use the
194 option instead. It is slower, but it will preserve your data.
198 option will cause badblocks to output a possibly incomplete list of
199 bad blocks. Therefore it is recommended to use it only when one wants
200 to know if there are any bad blocks at all on the device, and not when
201 the list of bad blocks is wanted.
204 was written by Remy Card <Remy.Card@linux.org>. Current maintainer is
205 Theodore Ts'o <tytso@alum.mit.edu>. Non-destructive read/write test
206 implemented by David Beattie <dbeattie@softhome.net>.
209 is part of the e2fsprogs package and is available from
210 http://e2fsprogs.sourceforge.net.