2 .TH BADBLOCKS 8 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
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 by the filesystem.
64 For this reason, it is strongly recommended that
69 directly, but rather use the
79 Specify the size of blocks in bytes. The default is 1024.
81 .BI \-c " number of blocks"
82 is the number of blocks which are tested at a time. The default is 64.
85 Normally, badblocks will refuse to do a read/write or a non-destructive
86 test on a device which is mounted, since either can cause the system to
87 potentially crash and/or damage the filesystem even if it is mounted
88 read-only. This can be overridden using the
90 flag, but should almost never be used --- if you think you're smarter
93 program, you almost certainly aren't. The only time when this option
94 might be safe to use is if the /etc/mtab file is incorrect, and the device
98 Read a list of already existing known bad blocks.
100 will skip testing these blocks since they are known to be bad. If
102 is specified as "-", the list will be read from the standard input.
103 Blocks listed in this list will be omitted from the list of
105 bad blocks produced on the standard output or in the output file.
110 can be used to retrieve the list of blocks currently marked bad on
111 an existing filesystem, in a format suitable for use with this option.
113 .BI \-o " output_file"
114 Write the list of bad blocks to the specified file. Without this option,
116 displays the list on its standard output. The format of this file is suitable
125 .BI \-p " num_passes"
126 Repeat scanning the disk until there are no new blocks discovered in
127 num_passes consecutive scans of the disk.
128 Default is 0, meaning
130 will exit after the first pass.
132 .BI \-t " test_pattern"
133 Specify a test pattern to be read (and written) to disk blocks. The
135 may either be a numeric value between 0 and ULONG_MAX-1 inclusive, or the word
136 "random", which specifies that the block should be filled with a random
138 For read/write (\fB-w\fR) and non-destructive (\fB-n\fR) modes,
139 one or more test patterns may be specified by specifying the
141 option for each test pattern desired. For
142 read-only mode only a single pattern may be specified and it may not be
143 "random". Read-only testing with a pattern assumes that the
144 specified pattern has previously been written to the disk - if not, large
145 numbers of blocks will fail verification.
147 are specified then all blocks will be tested with one pattern
148 before proceeding to the next pattern.
151 Use non-destructive read-write mode. By default only a non-destructive
152 read-only test is done. This option must not be combined with the
154 option, as they are mutually exclusive.
157 Show the progress of the scan by writing out the block numbers as they
164 Use write-mode test. With this option,
166 scans for bad blocks by writing some patterns (0xaa, 0x55, 0xff, 0x00) on
167 every block of the device, reading every block and comparing the contents.
168 This option may not be combined with the
170 option, as they are mutually exclusive.
174 option on a device containing an existing file system.
175 This option erases data! If you want to do write-mode testing on
176 an existing file system, use the
178 option instead. It is slower, but it will preserve your data.
181 was written by Remy Card <Remy.Card@linux.org>. Current maintainer is
182 Theodore Ts'o <tytso@alum.mit.edu>. Non-destructive read/write test
183 implemented by David Beattie <dbeattie@softhome.net>.
186 is part of the e2fsprogs package and is available from
187 http://e2fsprogs.sourceforge.net.