Subject: How do I mark bad sectors on my "new" ESDI drives?
To: None <netbsd-help@netbsd.org>
From: Tony Reynolds <cctony@tp.backbone.olemiss.edu>
List: netbsd-help
Date: 10/31/1994 13:57:51
--------

I've recently recovered a pair of ESDI drives from a very old 386BSD effort. I 
have a new controller for them, and re-low-level formatted them. They have 
some bad sectors on them. I would like to know how to use bad144 on them, or 
failing that, badsect. This is about 450MB worth of disk that I'd rather not 
see go to waste.


Here's some info:
netbsd-1.0 from ftp.iastate.edu
wd0 is a 340MB IDE drive
wd1 is a 250MB IDE drive
wd2 is a 313MB ESDI drive (DTC 6280)
wd3 is a 151MB ESDI drive (DTC 6280)

Here are the disktab entries for wd2 and wd3, respectively:
m1558|Micropolis 1558 ESDI:\
:ty=winchester:ns#36:nt#15:nc#1223:\
        :dt=ESDI:\
        :pa#15884:oa#0:ba#8192:fa#1024:\
        :pb#33440:ob#16200:bb#8192:fb#1024:tb=swap:\
        :pc#660420:oc#0:bc#8192:fc#1024:\
        :pd#15884:od#341280:bd#4096:fd#512:\
        :pe#55936:oe#357480:be#8192:fe#1024:\
        :pf#246780:of#413640:bf#8192:ff#1024:\
        :pg#319140:og#341280:bg#8192:fg#1024:\
        :ph#291346:oh#49680:bh#8192:fh#1024:

cdc1|CDC Wren IV 94166-182:\
:ty=winchester:ns#36:nt#9:nc#968:\
        :dt=ESDI:\
        :pa#15884:oa#0:ba#8192:fa#1024:\
        :pb#33440:ob#16200:bb#8192:fb#1024:tb=swap:\
        :pc#313632:oc#0:bc#8192:fc#1024:\
        :pd#15884:od#49896:bd#4096:fd#512:\
        :pe#55936:oe#66096:be#8192:fe#1024:\
        :pf#191484:of#122148:bf#8192:ff#1024:\
        :pg#263736:og#49896:bg#8192:fg#1024:

I tried using badsect on wd2, after disklabel, newfs, and fsck. When you 
follow the procedure in badsect's man page, you get this:
tp# mount /dev/wd2c /mnt
tp# cd /mnt
tp# mkdir BAD
tp# badsect /mnt/BAD 660416
/dev/wd2c: Device busy

The same thing happens for wd3c.

(At this point you're supposed to umount/fsck the disk, which will fix the 
problem if you answer the question correctly at fsck time.)

I grabbed the 386bsd FAQs, and couldn't find anything about badsect or bad144 
with grep.

If this is an FAQ, please point the way. If not, I'll try to collect the 
responses into one for us.
(It may also be of limited use, because it's tougher and tougher to buy new 
ESDI drives these days.)

Thanks.
---
Tony Reynolds|cctony@tp.backbone.olemiss.edu|Telecomm Analyst II|(601)232-7206
Given a sufficient number of "scientists," at least one of them will propose a
fractal model for a given problem. -- Tony's Law of Fractal Propogation, 1993