mirror of
https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
synced 2024-12-14 04:16:01 +08:00
dd018f5aa4
badblocks.c: Fix non-destructive read/write patches from David Beattie. Non-standard variable-length automatic arrays removed. Non-destrutive write test fixed so that logic is clearer and more provably correct. (I believe the old code had a bug where the disk data wasn't restored if it was interrupted at the wrong time.) badblocks.8.in: Document new options in man page.
101 lines
2.2 KiB
Groff
101 lines
2.2 KiB
Groff
.\" -*- nroff -*-
|
|
.TH BADBLOCKS 8 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
|
|
.SH NAME
|
|
badblocks \- search a device for bad blocks
|
|
.SH SYNOPSIS
|
|
.B badblocks
|
|
[
|
|
.B \-svwn
|
|
]
|
|
[
|
|
.B \-b
|
|
.I block-size
|
|
]
|
|
[
|
|
.B \-c
|
|
.I blocks_at_once
|
|
]
|
|
[
|
|
.B \-i
|
|
.I input_file
|
|
]
|
|
[
|
|
.B \-o
|
|
.I output_file
|
|
]
|
|
[
|
|
.B \-p
|
|
.I num_passes
|
|
]
|
|
.I device
|
|
.IR blocks-count [ start-block ]
|
|
.SH DESCRIPTION
|
|
.B badblocks
|
|
is used to search for bad blocks on a device (usually a disk partition).
|
|
.I device
|
|
is the special file corresponding to the device (e.g
|
|
.IR /dev/hdc1 ).
|
|
.I blocks-count
|
|
is the number of blocks on the device.
|
|
.SH OPTIONS
|
|
.TP
|
|
.BI \-b " block-size"
|
|
Specify the size of blocks in bytes.
|
|
.TP
|
|
.BI \-c " number of blocks"
|
|
is the number of blocks which are tested at a time. The default is 16.
|
|
.TP
|
|
.BI \-i " input_file"
|
|
Read a list of already existing known bad blocks. Badblocks will skip
|
|
testing these blocks since they are known bad.
|
|
.TP
|
|
.BI \-o " output_file"
|
|
Write the list of bad blocks to the specified file. Without this option,
|
|
.B badblocks
|
|
displays the list on its standard output. The format of this file is suitable
|
|
for use by the
|
|
.
|
|
.B \-l
|
|
option in
|
|
.BR e2fsck (8)
|
|
or
|
|
.BR mke2fs (8).
|
|
.TP
|
|
.BI \-p " num_passes"
|
|
Repeat scanning the disk until there are no new blocks discovered after
|
|
num_passes scans of the disk.
|
|
.TP
|
|
.B \-n
|
|
Use non-destructive read-write mode.
|
|
.TP
|
|
.B \-s
|
|
Show the progress of the scan by writing out the block numbers as they
|
|
are checked.
|
|
.TP
|
|
.B \-v
|
|
Verbose mode.
|
|
.TP
|
|
.B \-w
|
|
Use write-mode test. With this option,
|
|
.B badblocks
|
|
scans for bad blocks by writing some patterns (0xaa, 0x55, 0xff, 0x00) on
|
|
every block of the device, reading every block and comparing the contents.
|
|
.SH WARNING
|
|
Never use the
|
|
.B \-w
|
|
option on an device containing an existing file system.
|
|
This option erases data!
|
|
.SH AUTHOR
|
|
.B badblocks
|
|
was written by Remy Card <card@masi.ibp.fr>, the developer and maintainer
|
|
of the ext2 fs. Current maintainer is Theodore Ts'o <tytso@alum.mit.edu>.
|
|
Non-destructive read/write test implemented
|
|
by David Beattie <dbeattie@usa.net>.
|
|
.SH AVAILABILITY
|
|
.B badblocks
|
|
is part of the e2fsprogs package and is available for anonymous
|
|
ftp from tsx-11.mit.edu in /pub/linux/packages/ext2fs.
|
|
.SH SEE ALSO
|
|
.BR e2fsck (8),
|
|
.BR mke2fs (8)
|