Subject: Re: Bad sector troubles.
To: Boris Gjenero <bgjenero@undergrad.math.uwaterloo.ca>
From: Bertram Barth <bertram@gummo.bbb.sub.org>
List: port-vax
Date: 03/11/1997 21:40:27
Boris Gjenero writes:
> Anders Magnusson wrote:
> > Test 70 (I think) should rebuild the bad-sector map.
> 
> Ouch!  That's a complete reformat.  So there is no non-destructive way? 
> It's not too bad now, but what if a new bad sector shows up later. 

AFAIK there's no way to rebuild this map within the VS2000's rom-routines.
The only way something like that to be done I can think of is some (yet to
be written) system-software in NetBSD/vax...

> > DEC STANDARD 144 bad sector forwarding were used on old disks
> > (e.g. Massbus disks). MSCP and MFM disks uses another way, hidden from
> > the user. I don't know how it works, and doesn't have any docs for
> > it, but the spare sectors are located outside the range accessible from
> > normal NetBSD handling. The controller replaces the bad sectors
> > automatically without any driver intervention.
> > I know this is true for MSCP disks, and I think it works the same way
> > on MFM disks.

The MFM-controller on VS2000 is different from a MSCP-controller.
It accesses the disk via c/t/s, thus it's really important to use
the correct physical geomtry for the disklabel. Also this controller
can't do LBN addressing and it doesn't do bad-sector-replacement
automagically. IIRC There's an on-disk structure somewhere in cylinder 0
which holds the replacement-information. I think this information is
similiar/compatible to the hidden information on the MSCP-disks, but
within the VS2000 configuration these sectors/information is visible.
Accessing the replacement sectors has to be done via software since
there's no support from the controller...

> Hmm...  I doubt it.  Take a look at the disktab for an RD53 on MSCP:
> :ns#18:nt#8:nc#963:
> 18*8*963=138672
> Now here are the actual specs for the RD53 which are used for the MFM
> device:
> Sectors/track:17  Read/write heads:8  Cylinders:1024 
> 17*8*1024=139264  (592 more sectors, probably replacements on MSCP)
> If I actually use the real physical specs in edlabel (as you have to
> with the mfm device), then there is no way that some other space for bad
> sector replacement could exist.  I'm using the whole drive.  This brings
> up two questions:

With an MSCP-controller this RD53 is not accessed via c/t/s but via LBN.
The reserved sectors are invisible to the software, replacement is done
via the controller. Since the real geometry is invisible to the software,
you can't know where these 592 reserved sectors are located. AFAIK they
are not continous and not all of them are replacement sectors.

Away from that, if you label your MSCP disk the above mentioned way
you'll not realize any problems unless the sectors with LBN above 138672
are accessed. These LBNs are just out-of-range for that type of disk.

> 1 - Does NetBSD even use the bad sector replacement stuff on the VS2000
> or does it just write straight to real physical sectors? 

At the moment all sectors are believed to be good. No sector replacement
is respected. All physical sectors are accessible via the MFM-controller,
since real c/t/s addressing is done. Access of replacement sectors instead 
of the defect sectors has to be done via software, and this feature is not 
implemented.

> 2 - Assuming it does, how do I make sure that it doesn't trash the
> replacements?  Should I just reserve 592 sectors at the end of the
> drive?

592 is not(!) the number of replacement-sectors.

Ciao,
	bertram