[comp.sys.3b1] Fun with the Bad Block Table

cmv@cbnewsc.cb.att.com (C M Votava) (02/16/91)

Helpful hint:

	Use "iv -tv /dev/rfp000" to get a printout of your bad block table

I don't know how many people knew that, but it was a pleasant suprise
for me! Anyway, I've spent the last few days going through that age-old
exercise that most of you have probably gone through... mapping the unix.log
output to a bad block.

Following in the time worn footsteps of many of you out there, I dutifully
got a copy of John Milton's hardware notes, and painfully figured out what
mathamagic was needed to turn the goofball output in the unix.log file to
physical block number that I could enter into the bad block table.

The device driver was complaining about Cyl:873 Trk:2 Sec:10, so I turned
this into a physical block number, entered it via the diagnostic disk,
rebooted the machine and checked it out --- still got the error! Well, I
must have goofed in the math... re-checked everything... same answer!
Had my wife (the math wiz) check it out... same answer. This was getting
annoying!

OK, maybe sector 10 really means sector 11, so I un-bad-block sec 10 and
bad-block sec 11. Still no good...rats! Well, after diddling around for a
couple of days with this garbage, I finally did something that bad-blocked
BOTH sectors 10 and 11... THAT WORKED! Just to double-check, I took each
out one at a time and re-verified... they BOTH have to be marked as bad
blocks to get rid of that nasty HDERR message.

Anybody know why??? I don't.

Thanks

-Craig Votava

cmv@ihlpf.att.com

dnichols@ceilidh.beartrack.com (DoN Nichols) (02/16/91)

In article <1991Feb15.231011.19453@cbnewsc.att.com> cmv@cbnewsc.cb.att.com (C M Votava) writes:
>Helpful hint:

	[ ... text deleted ... ]

>
>OK, maybe sector 10 really means sector 11, so I un-bad-block sec 10 and
>bad-block sec 11. Still no good...rats! Well, after diddling around for a
>couple of days with this garbage, I finally did something that bad-blocked
>BOTH sectors 10 and 11... THAT WORKED! Just to double-check, I took each
>out one at a time and re-verified... they BOTH have to be marked as bad
>blocks to get rid of that nasty HDERR message.
>
>Anybody know why??? I don't.

	Well, one consideration is that the unix-pc uses 512 byte PHYSICAL
sectors on the hard drive, and 1K LOGICAL blocks from within the system.  It
takes two physical sectors to make one logical block.  When you map out a
bad sector, it replaces it with a nearby sector, usually sector 17 from that
track.  However, if you have both physical sectors bad from a block, the
system may give up on reading a block when the first sector fails, and never
even TRY the second sector of the block.  (I don't have source, so this is
just a guess).

	Anyone who knows more of the internals have a better answer?

	Good Luck with the drive
		DoN.
-- 
Donald Nichols (DoN.)		| Voice (Days):	(703) 664-1585
D&D Data			| Voice (Eves):	(703) 938-4564
Disclaimer: from here - None	| Email:     <dnichols@ceilidh.beartrack.com>
	--- Black Holes are where God is dividing by zero ---

donlash@uncle.uucp (Donald Lashomb) (02/18/91)

In article <1991Feb15.231011.19453@cbnewsc.att.com> cmv@cbnewsc.cb.att.com (C M Votava) writes:
[...]
=OK, maybe sector 10 really means sector 11, so I un-bad-block sec 10 and
=bad-block sec 11. Still no good...rats! Well, after diddling around for a
=couple of days with this garbage, I finally did something that bad-blocked
=BOTH sectors 10 and 11... THAT WORKED! Just to double-check, I took each
=out one at a time and re-verified... they BOTH have to be marked as bad
=blocks to get rid of that nasty HDERR message.
=
=Anybody know why??? I don't.

Not really sure of this, but my guess is that the software deals with logical
blocks of 1024 bytes vs the physical blocks of 512 bytes (ie it uses pairs of
physical blocks).  Anyway, I just always lockout pairs when I get bad blocks,
so I never tried locking only one physical block to find out what would happen.

-Don
----
donlash@uncle.UUCP