Subject: Re: disklabel won't! (WAS: Re: Bootability eludes me once again)
To: Anne Bennett <anne@porcupine.montreal.qc.ca>
From: Frederick Bruckman <fredb@immanent.net>
List: port-i386
Date: 02/23/2003 09:17:42
On Sun, 23 Feb 2003, Anne Bennett wrote:
> I'm returning to a problem I left last May. At the time, I was not
> able to boot my i386 system from the first SCSI disk (sd0), and I could
> not figure out why. Since that time, I've been starting the boot from
> floppy, interrupting the countdown, and continuing to boot from the
> SCSI disk. Ugly, but at least I can use my system.
> Last May I responded to a suggestion from this list with:
>
> > I suppose that if the CHS translation is the problem, then a workaround
> > would be to make sure that the first sector of the NetBSD partition is
> > on track zero of the disk (using the smaller of the BIOS and NetBSD
> > sectors/track number). If the MBR is on sector zero only, then presumably
> > I can put my NetBSD partition as early as sector one, which leads me
> > to wonder why the default installation of NetBSD these days seems to
> > leave many sectors unused at the start of the disk.
>
> I tried backing the NetBSD partition down to sector 3, to make sure
> that it starts in the first "BIOS track". Here's the current
> state of affairs:
I don't understand the above. Normally, you leave the entire first
track for the BIOS do with what it will. So the NetBSD partition
should start at "32", CHS 0,1,1. The "c" partition, in the label,
should then also start at "32", and the "a" partition, same.
> | # fdisk sd0
> | NetBSD disklabel disk geometry:
> | cylinders: 4826 heads: 4 sectors/track: 107 (428 sectors/cylinder)
> |
> | BIOS disk geometry:
> | cylinders: 1010 heads: 64 sectors/track: 32 (2048 sectors/cylinder)
> |
> | Partition table:
> | 0: <UNUSED>
> | 1: <UNUSED>
> | 2: <UNUSED>
> | 3: sysid 169 (NetBSD)
> | start 3, size 102400 (50 MB), flag 0x80
> | beg: cylinder 0, head 0, sector 4
> | end: cylinder 50, head 0, sector 3
> |
> | # disklabel -r sd0
> | # /dev/rsd0d:
> | type: SCSI
> | disk: ST51080N
> | label: Quill_system
> | flags:
> | bytes/sector: 512
> | sectors/track: 107
> | tracks/cylinder: 4
> | sectors/cylinder: 428
> | cylinders: 4826
> | total sectors: 2070235
> | rpm: 3600
> | interleave: 1
> | trackskew: 0
> | cylinderskew: 0
> | headswitch: 0 # microseconds
> | track-to-track seek: 0 # microseconds
> | drivedata: 0
> |
> | 8 partitions:
> | # size offset fstype [fsize bsize cpg/sgs]
> | a: 102720 63 4.2BSD 1024 8192 16 # (Cyl. 0*- 240*)
> | b: 221212 102783 swap # (Cyl. 240*- 756*)
> | c: 2070232 3 unused 0 0 # (Cyl. 0*- 4836*)
> | d: 2070235 0 unused 0 0 # (Cyl. 0 - 4836*)
> | e: 513600 323995 4.2BSD 1024 8192 16 # (Cyl. 756*- 1956*)
> | f: 616320 837595 RAID # (Cyl. 1956*- 3396*)
> | g: 205440 1453915 4.2BSD 1024 8192 16 # (Cyl. 3396*- 3876*)
> | h: 410880 1659355 unused 0 0 # (Cyl. 3876*- 4836*)
> |
> | # disklabel sd0
> | # /dev/rsd0d:
> | type: SCSI
> | disk: SEAGATE ST51080
> | label: fictitious
> | flags:
> | bytes/sector: 512
> | sectors/track: 107
> | tracks/cylinder: 4
> | sectors/cylinder: 428
> | cylinders: 4826
> | total sectors: 2070235
> | rpm: 3600
> | interleave: 1
> | trackskew: 0
> | cylinderskew: 0
> | headswitch: 0 # microseconds
> | track-to-track seek: 0 # microseconds
> | drivedata: 0
> |
> | 8 partitions:
> | # size offset fstype [fsize bsize cpg/sgs]
> | c: 102400 3 unused 0 0 # (Cyl. 0*- 239*)
> | d: 2070235 0 unused 0 0 # (Cyl. 0 - 4836*)
> | h: 102400 3 unused 0 0 # (Cyl. 0*- 239*)
> | disklabel: boot block size 0
> | disklabel: super block size 0
>
> (I know that my partition "a" still starts at 63 instead of 3;
> starting the NetBSD partition at sector 3 is just an experiment, and I
> have not adjusted the NetBSD label.)
>
> What leaves me completely in the dark is why I seem to be able to
> write the disklabel, and it seems to be written to the disk, but I
> can't use it. I've been repeatedly trying to label this disk for over
> an hour, but I'm hitting a brick wall. What on earth?!?!?!
I guess "disklabel -r" is reading block 63, the second block of
partition "a". disklabel-sans-r doesn't know where "a" is; it reads
the in-core label, which the kernel develops from what's in block
4... or vice-versa, I don't know. :-)
If want to you see where the disklabel really is on the disk, it's
identifiable by the strings you supplied for the "name:" and "label:"
fields, like so:
fredb@tautology-> dd if=/dev/rwd0a skip=1 count=1 | strings
1+0 records in
1+0 records out
512 bytes transferred in 0.027 secs (18962 bytes/sec)
WDC WD600BB-00BS
fredb@tautology-> dd if=/dev/rwd1a skip=1 count=1 | strings
ST3120023A fictitious
1+0 records in
1+0 records out
512 bytes transferred in 0.010 secs (51200 bytes/sec)
Above is for a typical ATA set-up, with 63 sectors/track; the NetBSD
MBR partition, disklabel "a", and "c", all start at 63. I bet the root
of your problem is, that "sysinstall" failed to take into account that
your BIOS thinks your disk has 32 sectors/track, rather than the more
typical 63.
Frederick