Subject: disklabel won't! (WAS: Re: Bootability eludes me once again)
To: None <port-i386@netbsd.org>
From: Anne Bennett <anne@porcupine.montreal.qc.ca>
List: port-i386
Date: 02/23/2003 00:12:06
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.

Now I'm about to upgrade from 1.5.2 to 1.6, and I'm still having
trouble with that disk, but now it's even more basic: I can't get a
working disk label on it any more.

This makes the problem description much simpler.  I'm going to show
output obtained using NetBSD 1.5.2, but the results were similar using
1.6 from the boot floppies.

Summary: I can write an MBR with fdisk, and fdisk reports the MBR
I just wrote.  The disk then claims no label, so I create one with
"disklabel -I -e sd0".  This label is written to the disk, as
evidenced by the output from "disklabel -r sd0", but somehow the
incore copy is not updated: "disklabel sd0" still claims no label
and gives a fictitious one, and I cannot refer to the partitions
on that disk.

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:

|  # 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?!?!?!


Anne.
-- 
Ms. Anne Bennett, as a private citizen:  anne@porcupine.montreal.qc.ca
Also reachable more officially at work:  anne@alcor.concordia.ca