sparing bad blocks

John G. De Armond jgd at rsiatl.UUCP
Mon Nov 27 22:43:20 AEST 1989

In article <5556 at> bt455s10 at (Carl "Art" McIntosh) writes:
>How does one map out bad sectors under ISC 2.02 ? 
>I have tried to map out a new bad sector reported
>by a console message giving the absolute sector,
>the drive and controller numbers.  According to
>the man page mkpart(1M) the -A option should do
>the trick, however mkpart -A 266867 disk0 yields
>the message V_REMOUNT failed and informs me a
>reboot or remount or the device is required. 
>after rebooting the system, the /etc/partitions
>file does not list the new bad sector, furthermore
>mkpart -t vpa disk0 does not show sector 266867
>as having been remapped.  Anyone know how this
>supposedly simple procedure is done ?

God, this is deja vu, having been working with  large drive containing 
hundreds of bad sectors. :-)

What you did worked, the problem is a matter of interpretation.  The
/etc/partitions file is a read-only prototype file for mkpart.  It is 
NOT updated by mkpart.  To view the Volume Table of Contents (VTOC),
invoke mkpart with the command:

mkpart -tvpa disk1

This makes mkpart print out statistics on the drive.  I've found it
invaluable to make a hardcopy of this table for when the volume 
gets wiped out.  You don't have to rediscover the bad sectors all
over again.

You should be aware of a terrible problem with mkpart that makes it
extremely dangerous.  If /etc/partitions gets altered or corrupted
and you invoke mkpart - even for a read-only status request as above -
it will without your permission try to force the drive VTOC to agree
with /etc/partitions.  Usually this results in a trashed volume.
I learned this the hard way when I moved a large drive off the root
and installed a small, fast drive for the root partition.  When 
I restored the root partition from tape, the previous /etc/partitions
file got written out.  After restoring the /usr and other partitions
to the large drive, I used the -tvpa option to print out 
statistics on the new configuration.  Voila! Trashed root partition.
I've changed permissions on /etc/partitions to read-only, root AND
keep a checksum handy to use before invoking mkpart.

Next, a question for the interactive types.  Why does the -V or -v 
option with an Adaptec 1542 SCSI controller not work?   I can hear
the drive retry several times on each bad sector but the program 
never reports one.  When a bad sector is encountered in operation,
I hear only one retry before the kernal reports a problem.  I
had to collect bad sector information by dd'ing from /dev/dsk/0s1 etc
and logging the kernal messages.  What a bitch!

One more comment.  If your drive/controller  has a low level bad sector
mapping facility, USE IT.  The Interactive facility seems very fragile.
I took the drive in question out of service and repeatedly assaulted it
with the Adaptec firmware mapping program (HINT:  reprogram the typmatic
action on the keyboard for about 1 character per second and sit a 
large ball-pein hammer on the "Y" key :-).  I let the program run
until it would run for 24 hours without finding an additional bad sector.
When I put the drive back in service, it was like a whole different 
drive.  Where before it would grow a bad sector or 2 a day, it has been
up for about 3 weeks with nary a peep.

Hint to Adaptec:  PLEASE give me a verify mode where I don't have to 
hit the damn 'Y' key for every bad sector.  A batch mode would be fine.


John De Armond, WD4OQC                     | Manual? ... What manual ?!? 
Radiation Systems, Inc.     Atlanta, GA    | This is Unix, My son, You 
emory!rsiatl!jgd          **I am the NRA** | just GOTTA Know!!! 

More information about the Comp.unix.i386 mailing list