Subject: BSD/OS disklabels?
To: None <port-i386@netbsd.org>
From: Lars-Johan Liman <liman@sunet.se>
List: port-i386
Date: 05/22/2000 20:37:43
Hi!

Any disklabel Gurus out there with a moment to spare?

I have "upgraded" an old system from BSD/OS 3.1 to NetBSD-current 1.4Q
(this was a while back). In doing so I changed much hardware, added a
new diskdrive that I loaded fresh installations onto, but kept the old
drive as "secondary", to be able to move data from it easily.

Old config: PPro 200
	    4.3 GB Seagate Cheetah, shared NT and BSD/OS (sd0)
            ASUS 875 (ncr) SCSI controller

New config: AMD K7/750
	    9 GB IBM Deskstar LVD, shared NT and NetBSD (sd0)
      (old) 4.3 GB Seagate Cheetah, shared NT and BSD/OS "untouched" (sd1) 
	    Qlogic 1280 SCSI controller

The Qlogic controller has a different "BIOS" opinion about the
drive parameters for the Cheetah drive than the ASUS controller does.

If I boot NT from the IBM drive, NT is quite capable of finding the
"old" NT partition on the Cheetah drive and mount it as D:. That's "no
wonder", since it's the first partition on the drive, and since
everyone agrees that there are 63 sectors per track. :-)

If I boot NetBSD from the IBM drive and start looking for the various
BSD/OS partitions (sd1[a-h]) on the Cheetah drive, I get a "no
disklabel" message.

The FDISK label is found and (seemingly) interpreted correctly, _but_
the C/H/S values are of course incorrect, since they are calculated
with the geometry according to the ASUS opinion of the drive.

Even if I try to adjust the FDISK C/H/S values (to count for the
different "BIOS" values) for the BSDI partition (leaving the NT
partition untouched with the old "wrong" values), so that it matches
the actual sector numbers, it still doesn't work. (Granted: in this
situation, the partition border is no longer on a cylinder boundary.)

My first question: should it work? (I.e., does NetBSD recognize BSD/OS
disklabels?)

Secondly: Is there a trick to make NetBSD find the "lost" disklabel?
(E.g., do I have to change the FDISK partition type from 159 to 169?
The FDISK partition is correctly recognized as "BSDI?".)

Thirdly: If not, what are the risks with just creating a NetBSD disk
label with the correct sector numbers in it (disklabel -r ...)? Where
is the NetBSD disklabel stored, in the boot sectors or in the NetBSD
partition? Any risk of overwriting _other_ crucial information than a
non-functioning disklabel by creating a NetBSD disklabel (like the
super-block of the BSD/OS sdXa partition)?

The BSD/OS label is still there somwhere, because if I swap SCSI
controllers, and boot off ASUS/Cheetah, BSD/OS runs just fine, and is
quite willing to tell me where the partition borders are. Booting
BSD/OS off Qlogic/Cheetah is not an option, since the vintage BSD/OS
that I have access to, doesn't support Qlogic, but does a rather
ungraceful panic while probing the board. :-(

Any hints?


				Cheers,
				  /Liman

PS. I _DO_ have a proper tape backup of the drive in question ... ;-)

#----------------------------------------------------------------------
# What the DNS really needs, is CLUE records ... ;-)
#----------------------------------------------------------------------
# Lars-Johan Liman, Systems Specialist	! E-mail: liman@sunet.se
# KTH Network Operations Centre         ! HTTP  : //www.sunet.se/~liman
# Royal Institute of Technology, Sweden	! Voice : Int +46 8 - 790 65 60
#----------------------------------------------------------------------