Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jan 1996 22:47:01 +1030 (CST)
From:      michael smith <miff@spam.frisbee.net.au>
To:        hackers@freebsd.org
Subject:   location of bad144 table
Message-ID:  <Pine.BSF.3.91.960115222713.19883A-100000@lovely>

next in thread | raw e-mail | index | archive | help

(*grumble*) how does one get Pine to add a Reply-To: ? 8(

A question I would ask of those who Might Know The Answer 8)

Currently, the bad144 code in kern/subr_dkbad.c looks for the replacement
table on the last track of the unit, as specified by the disklabel, to wit:

               bp->b_blkno = lp->d_secperunit - lp->d_nsectors + i;

(for i 0,2...8)

Unfortunately I have a disk controller here (Adaptec 2320D) that lies about
how big the disk is (advertises one more cylinder than there is), and so
this dies in a heap.

I've tried just about everything I can think of to force the label to 
reflect the true size of the disk rather than its advertised size, but
I suspect that I'm at a bit of a disadvantage in that I can't have these
disks visible to the BIOS because I'm booting from a SCSI disk.

There would appear to be several possible options.  

- I can check the ESDI ID string that the controller reports and adjust
the cylinder count accordingly.  This would require a small change to wd.c
that I'm quite happy to implement and test, providing I can find someone
else using one of these controllers.  (Wilko, BTW, this guy only does
35s/t as well 8( )

- The calculation above could be modified to check the 'c' partition on the
disk first.  This would facilitate using the sizing of the 'c' partition
to lie about the size of the disk (what I was trying before).  NOTE: this
is consistent with the way that the bad144 program operates; I was quite
fooled by its success 8(.

As an aside, bad things happen if the bad sector table is not initialised
before it is used the first time.  (IIRC, the invocation was 
'bad144 -a -v wd0'.  This is non-obvious from the manpage)

So, any comments?  

Mike

(ps.  I'm posting from home 'coz the link to my 'normal' acount is spammed.
      You may also know me as msmith@atrad.adelaide.edu.au)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.91.960115222713.19883A-100000>