.TH badscan "" "" Command
.PC "Build bad block list"
\fB/etc/badscan [ -v ] [ -o \fIproto\fB ] [ -b \fIboot\fB ] \fIdevice size\fR
\fB/etc/badscan [ -v ] [ -o \fIproto\fB ] [ -b \fIboot\fB ] \fIdevice xdevice\fR
.PP
.HS
.SH Options:
.IC "\fB\-b\fI boot\fR"
Insert bootstrap \fIboot\fR into \fIproto\fR
.IC "\fB\-o\fI proto\fR"
Write prototype into file \fIproto\fR
.IC "\fB\-v\fR"
Print estimate of time remaining
.Pp
Scan \fIdevice\fR of \fIsize\fR bytes
(or size given in hard disk partition table
\fIxdevice\fR) for bad blocks, write prototype to stdout.
.HE
.B badscan
scans a floppy disk or a partition of the hard disk for bad blocks.
It writes onto the standard output
a prototype file that lists all bad blocks on the disk.
.PP
.B badscan
recognizes the following options:
.RS
.IP \fB\-v\fR 0.8i
Print an estimate of time needed to finish examining the device.
.IP "\fB\-o \fIproto\fR"
Redirect output into file
.IR proto .
.IP "\fB\-b \fIboot\fR"
Insert a given \fIboot\fR into the proto file as the bootstrap.
The default is
.BR /conf/boot .
.PP
.I device
names the special device to scan.
.PP
The command line for
.B badscan
comes in two forms, as shown at the top of this article.
The first version is for a floppy disk;
.I size
gives the size of the device, in blocks.
The second version is for a hard-disk partition;
.I xdevice
specifies devices
.B /dev/at0x
or
.BR /dev/at1x ,
which hold the partition-table information for the disk in question.
.B badscan
reads the data from  the boot block of the drive to find the size of the
.BR device .
.SH Examples
The first example uses
.B badscan
to find all bad blocks on a high-density, 3.5-inch floppy disk in drive
1 (i.e., drive B), and writes its output into file
.BR proto :
.DM
	/etc/badscan -v -o proto /dev/rfva1 2880
.DE
.PP
See the article
.B "floppy disks"
for a table that gives the device name and number of sectors to be found
on the various types of floppy disk that \*(CO recognizes.
.PP
The second example uses
.B badscan
to prepare a list of bad blocks for partition 2 on hard-drive 0, which is an
IDE drive accessed via \*(CO's \fBat\fR driver.
Again, the output is written into file
.BR proto :
.DM
	/etc/badscan -v -o /conf/proto.at0c /dev/rat0c /dev/at0x
.DE 
.SH "See Also"
.Xr at, at
.Xr bad, bad
.Xr commands, commands
.Xr "floppy disks," floppy_di
.Xr mkfs mkfs
.SH Notes
Because SCSI hard-disk drives maintain their own map of bad blocks,
.B badscan
is not required for SCSI drives.
However, we recommend that you use it on removeable-media SCSI drives.
