blob: 9dfe0f270520331337e830f98fdb5a292a87c795 [file] [log] [blame]
Theodore Ts'o3839e651997-04-26 13:21:57 +00001.\" -*- nroff -*-
Theodore Ts'o74becf31997-04-26 14:37:06 +00002.TH BADBLOCKS 8 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
Theodore Ts'o3839e651997-04-26 13:21:57 +00003.SH NAME
4badblocks \- search a device for bad blocks
5.SH SYNOPSIS
6.B badblocks
7[
Theodore Ts'odd018f52000-02-06 23:57:07 +00008.B \-svwn
9]
10[
Theodore Ts'o3839e651997-04-26 13:21:57 +000011.B \-b
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000012.I block-size
Theodore Ts'o3839e651997-04-26 13:21:57 +000013]
14[
Theodore Ts'odd018f52000-02-06 23:57:07 +000015.B \-c
16.I blocks_at_once
17]
18[
19.B \-i
20.I input_file
21]
22[
Theodore Ts'o3839e651997-04-26 13:21:57 +000023.B \-o
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000024.I output_file
Theodore Ts'o3839e651997-04-26 13:21:57 +000025]
26[
Theodore Ts'odd018f52000-02-06 23:57:07 +000027.B \-p
28.I num_passes
Theodore Ts'o3839e651997-04-26 13:21:57 +000029]
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000030.I device
31.IR blocks-count [ start-block ]
Theodore Ts'o3839e651997-04-26 13:21:57 +000032.SH DESCRIPTION
33.B badblocks
34is used to search for bad blocks on a device (usually a disk partition).
Theodore Ts'o3839e651997-04-26 13:21:57 +000035.I device
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000036is the special file corresponding to the device (e.g
37.IR /dev/hdc1 ).
Theodore Ts'o3839e651997-04-26 13:21:57 +000038.I blocks-count
39is the number of blocks on the device.
40.SH OPTIONS
41.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000042.BI \-b " block-size"
Theodore Ts'o3839e651997-04-26 13:21:57 +000043Specify the size of blocks in bytes.
44.TP
Theodore Ts'odd018f52000-02-06 23:57:07 +000045.BI \-c " number of blocks"
46is the number of blocks which are tested at a time. The default is 16.
47.TP
48.BI \-i " input_file"
49Read a list of already existing known bad blocks. Badblocks will skip
50testing these blocks since they are known bad.
51.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000052.BI \-o " output_file"
Theodore Ts'odd018f52000-02-06 23:57:07 +000053Write the list of bad blocks to the specified file. Without this option,
Theodore Ts'o3839e651997-04-26 13:21:57 +000054.B badblocks
Theodore Ts'o92bcc591998-02-16 22:29:34 +000055displays the list on its standard output. The format of this file is suitable
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000056for use by the
Theodore Ts'odd018f52000-02-06 23:57:07 +000057.
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000058.B \-l
59option in
Theodore Ts'o92bcc591998-02-16 22:29:34 +000060.BR e2fsck (8)
61or
62.BR mke2fs (8).
Theodore Ts'o3839e651997-04-26 13:21:57 +000063.TP
Theodore Ts'odd018f52000-02-06 23:57:07 +000064.BI \-p " num_passes"
65Repeat scanning the disk until there are no new blocks discovered after
66num_passes scans of the disk.
67.TP
68.B \-n
69Use non-destructive read-write mode.
70.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000071.B \-s
Theodore Ts'oca8abba1998-01-19 14:55:24 +000072Show the progress of the scan by writing out the block numbers as they
73are checked.
74.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000075.B \-v
Theodore Ts'o3839e651997-04-26 13:21:57 +000076Verbose mode.
77.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000078.B \-w
Theodore Ts'o3839e651997-04-26 13:21:57 +000079Use write-mode test. With this option,
80.B badblocks
81scans for bad blocks by writing some patterns (0xaa, 0x55, 0xff, 0x00) on
82every block of the device, reading every block and comparing the contents.
83.SH WARNING
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000084Never use the
85.B \-w
86option on an device containing an existing file system.
Theodore Ts'o3839e651997-04-26 13:21:57 +000087This option erases data!
88.SH AUTHOR
89.B badblocks
Theodore Ts'offe4cab2000-04-03 13:27:41 +000090was written by Remy Card <Remy.Card@linux.org>. Current maintainer is
91Theodore Ts'o <tytso@alum.mit.edu>. Non-destructive read/write test
92implemented by David Beattie <dbeattie@usa.net>.
Theodore Ts'o3839e651997-04-26 13:21:57 +000093.SH AVAILABILITY
94.B badblocks
Theodore Ts'oa789d841998-03-30 01:20:55 +000095is part of the e2fsprogs package and is available for anonymous
96ftp from tsx-11.mit.edu in /pub/linux/packages/ext2fs.
Theodore Ts'o3839e651997-04-26 13:21:57 +000097.SH SEE ALSO
98.BR e2fsck (8),
99.BR mke2fs (8)