Subject: Re: mirrored root w/ raidframe - howto install bootblock?
To: None <port-sparc@NetBSD.org>
From: Sean Davis <dive-nb@endersgame.net>
List: port-sparc
Date: 05/14/2006 00:09:00
On Sun, May 14, 2006 at 01:37:18AM +0200, Hubert Feyrer wrote:
> 
> I'm trying to follow the NetBSD Guide in installing a 3.0/sparc system 
> with two identical harddisks to have them mirrored with RAIDframe.
> I've setup the system, and the second disk has a RAID partition with a 
> root filesystem, swap/dump are also configured.
> 
> The next step at 
> http://www.netbsd.org/guide/en/chap-rf.html#chap-rf-moving-files is to 
> install boot blocks, and this is where I'm having problems. The 
> disklabels look like this:
> 
> 	# disklabel sd0
> 	#        size    offset     fstype [fsize bsize cpg/sgs]
> 	 a:  17781520         0       RAID                     # (Cyl.      
> 	 0 -  11509*)
> 	 b:   1049026  16732350       swap                     # (Cyl.  
> 	 10830 -  11508*)
> 	 c:  17781520         0     unused      0     0        # (Cyl.      
> 	 0 -  11509*)
> 
> 	# disklabel raid0
> 	#        size    offset     fstype [fsize bsize cpg/sgs]
> 	 a:  16732159         0     4.2BSD   1024  8192 46480  # (Cyl.      
> 	 0 -  16339*)
> 	 b:   1049216  16732160       swap                     # (Cyl.  
> 	 16340 -  17364*)
> 	 c:  17781376         0     unused      0     0        # (Cyl.      
> 	 0 -  17364*)
> 
> Looking at the sparc installboot(8) manpage, it suggests the following 
> command to install boot blocks:
> 
> 	installboot /dev/rsd0c /usr/mdec/bootxx /boot
> 
> and following the Guide, I use rsd0a instead of rsd0c. But this gives:
> 
> 	# installboot -v /dev/rsd0a /usr/mdec/bootxx /boot
> 	File system:         /dev/rsd0a
> 	File system type:    raw (blocksize 8192, needswap 0)
> 	Primary bootstrap:   /usr/mdec/bootxx
> 	Secondary bootstrap: /boot
> 	installboot: Need `-B bno' for raw file systems
> 	installboot: Set bootstrap operation failed
> 
> I guess that installboot can't find /boot inside the RAID volume on sd0a,
> but how do I figure out the block number of that file for -B?
> 
> Or am I missing something fundamentally, and mirrored root filesystem 
> can't be done on sparc?

While I don't recall off the top of my head the steps I used, I know
raidframe raid 1 works just fine on sparc64, so I would tend to assume it'll
work on sparc as well. I seem to remember using installboot on rsd[01]a,
though it was a while ago when I set this up so it could have been rsd[01]c.

I encountered no problems with installboot, so I'm not sure if that's a
recent change (my netra runs 3-stable) or something that's different between
raidframe on sparc and sparc64.

Just in case it helps, my setup is as follows (this is a netra t1 105):

uname / drives:

NetBSD xenocide 3.0_STABLE NetBSD 3.0_STABLE (XENOCIDE) #0: Mon May  1
22:45:20 EDT 2006
dive@jane.endersgame.net:/disks/wd4a/xenocide/obj/sys/arch/sparc64/compile/XENOCIDE
sparc64

sd0 at scsibus0 target 0 lun 0: <SEAGATE, ST318203LSUN18G, 034A> disk fixed
sd0: 17274 MB, 7508 cyl, 19 head, 248 sec, 512 bytes/sect x 35378533 sectors
sd0: sync (50.00ns offset 15), 16-bit (40.000MB/s) transfers, tagged
queueing
sd1 at scsibus0 target 1 lun 0: <SEAGATE, ST318203LSUN18G, 034A> disk fixed
sd1: 17274 MB, 7508 cyl, 19 head, 248 sec, 512 bytes/sect x 35378533 sectors
sd1: sync (50.00ns offset 15), 16-bit (40.000MB/s) transfers, tagged
queueing
raid0: RAID Level 1
raid0: Components: /dev/sd1a /dev/sd0a
raid0: Total Sectors: 35378432 (17274 MB)
root on raid0a dumps on raid0b

Disklabels:

xenocide# disklabel sd0|tail -3
#        size    offset     fstype [fsize bsize cpg/sgs]
 a:  35378533         0       RAID                     # (Cyl.      0 -
7508*)
 c:  35378533         0     unused      0     0        # (Cyl.      0 -
7508*)

xenocide# disklabel sd1|tail -3
#        size    offset     fstype [fsize bsize cpg/sgs]
 a:  35378533         0       RAID                     # (Cyl.      0 -
7508*)
 c:  35378533         0     unused      0     0        # (Cyl.      0 -
7508*)

xenocide# disklabel raid0|tail -7
#        size    offset     fstype [fsize bsize cpg/sgs]
 a:   1048576         0     4.2BSD   1024  8192 43696  # (Cyl.      0 -
1023)
 b:   2097152   1048576       swap                     # (Cyl.   1024 -
3071)
 c:  35378432         0     unused      0     0        # (Cyl.      0 -
34549*)
 d:    262144   3145728     4.2BSD   1024  8192 32768  # (Cyl.   3072 -
3327)
 e:   2097152   3407872     4.2BSD   1024  8192 45592  # (Cyl.   3328 -
5375)
 f:  29873408   5505024     4.2BSD   1024  8192 46536  # (Cyl.   5376 -
34549*)

HTH,

-Sean