Subject: Re: RAIDFrame and NetBSD/sparc booting issues
To: Julian C. Dunn <lists@aquezada.com>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: port-sparc
Date: 08/11/2003 11:08:12
On Sun, Aug 10, 2003 at 04:56:36PM -0400, Julian C. Dunn wrote:
> I'm setting up RAIDFrame on an old Sparc 2 as an experiment. What I'm
> trying to understand is the booting procedure and how this will impact
> the way in which the kernel is installed, etc.
> 
> I know that on NetBSD/i386, we have to create a small 4.2BSD partition
> for the secondary bootblocks to reside upon, since the primary boot
> can't talk to RAID partitions directly (yet). Figuring that this was the
> same scenario on a Sun, I created a disklabel as follows:
> 
> 3 partitions:
> #        size    offset     fstype  [fsize bsize cpg/sgs]
>  a:      2440         0     4.2BSD   1024  8192   136   # (Cyl.    0 -
> 3)
>  b:   4107560      2440       RAID                      # (Cyl.    4 -
> 6737*)
>  c:   4110000         0     unused      0     0         # (Cyl.    0 -
> 6737*)
> 
> and did a:
> 
> 	athena# mount /dev/sd1a /mnt
> 	athena# cp /usr/mdec/boot /mnt
> 	athena# installboot /dev/rsd1c /usr/mdec/bootxx /boot
> 
> Ok, so when I do "boot /sbus/esp@0,800000/sd@4,0" from the PROM, the
> secondary bootloader rightly complains that it can't find any kernels.
> Does this mean that the "a" partition above has to be large enough to
> contain a kernel, and that I should install a kernel there as well? What
> about /etc? What other parts need to reside there?
> 
> My question is basically this: How much of a system do I need to install
> on that "a" partition to get to the point where the box will remount the
> autoconfigured RAID root partition over top of the temporary root?

Only the kernel.

I've only one sparc running with raid. I did a hugly hack: I made
sd0a (and sd1a) match the raid0a partition. This mean that I can mount
the root partition with 3 different ways: raid0a, sd0a and sd1a.
Of course you have to be very carefull not mounting more than one
R/W !

here is how my disklabel looks like:
reggae:/#disklabel sd0
# /dev/rsd0c:
type: SCSI
disk: ST15230N
label: Seagate-ST15230N
flags:
bytes/sector: 512
sectors/track: 110
tracks/cylinder: 19
sectors/cylinder: 2090
cylinders: 3992
total sectors: 8343280
rpm: 5411
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:    99274     2090     4.2BSD     1024  8192    16   # (Cyl.    1 - 48*)
  b:   397036   102410       swap                        # (Cyl.   49 - 238*)
  c:  8343280        0    unknown                        # (Cyl.    0 - 3991)
  d:   499510        0       RAID                        # (Cyl.    0 - 238)
  e:  7843770   499510       RAID                        # (Cyl.  239 - 3991)
reggae:/#disklabel raid0
# /dev/rraid0c:
type: RAID
disk: raid
label: default label
flags:
bytes/sector: 512
sectors/track: 1013
tracks/cylinder: 2
sectors/cylinder: 2026
cylinders: 24
total sectors: 499392
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0 

3 partitions:
#        size   offset     fstype   [fsize bsize cpg/sgs]
  a:    99274     2026     4.2BSD     1024  8192    32   # (Cyl.    1 - 49)
  b:   398092   101300       swap                        # (Cyl.   50 - 246*)
  c:   499392        0     unused        0     0         # (Cyl.    0 - 246*)

The offsets in raid0 and sd0 have been computed so that the partition
is aligned on cylinder boundaries in both (disklabel will complain otherwise,
which is silly for the raid0 case). I also changed the geometry of raid0.
sd0b matches raid0b; raid0b is for swap and sd0b for dumps.
There is an offset between the sd0 and raid0 partition offsets: this is
because raidframe reserve some place (64 sectors) at the start of its
partition so store information.

This hack works, but you have to really understand what you're doing with the
offsets.

> 
> Also, am I correct in my understanding that the partition containing the
> secondary bootblocks on a Sparc *MUST* be the first partition on the
> disk? i.e. this wouldn't work if I made "f" to be the same size and
> offset as "a" instead. Or does it have to do with the partition that is
> physically at the beginning of the disk and is irrespective of the
> disklabel.

It doens't care if it's at the start of the disk or not. As der mouse said,
if you don't use the 'a' partition, you have to specify it on the boot command.

--
Manuel Bouyer, LIP6, Universite Paris VI.           Manuel.Bouyer@lip6.fr
     NetBSD: 24 ans d'experience feront toujours la difference
--