Subject: raidframe on sparc64
To: None <netbsd-help@netbsd.org>
From: Thierry Lacoste <th.lacoste@wanadoo.fr>
List: netbsd-help
Date: 01/03/2006 21:01:15
After a fresh install of 3.0/sparc64 on an ultra1 I'm having
problems configuring a RAID-1 root disk as described in
chapter 15 of the NetBSD guide.
It appears that I'm unable to configure a swap area because
of cylinder boundaries.

Here is the seting after installing on sd0:

algol# uname -a
NetBSD algol.miage.univ-paris12.fr 3.0 NetBSD 3.0 (GENERIC) #0: Mon Dec 19 
04:05:17 UTC 2005  
builds@b4.netbsd.org:/home/builds/ab/netbsd-3-0-RELEASE/sparc64/200512182024Z-obj/home/builds/ab/netbsd-3-0-RELEASE/src/sys/arch/sparc64/compile/GENERIC 
sparc64

algol# grep ^sd /var/run/dmesg.boot
sd0 at scsibus0 target 0 lun 0: <SEAGATE, ST32430W SUN2.1G, 0666> disk fixed
sd0: 2049 MB, 3992 cyl, 9 head, 116 sec, 512 bytes/sect x 4197405 sectors
sd0: sync (100.00ns offset 15), 8-bit (10.000MB/s) transfers
sd1 at scsibus0 target 1 lun 0: <SEAGATE, ST32430W SUN2.1G, 0508> disk fixed
sd1: 2049 MB, 3992 cyl, 9 head, 116 sec, 512 bytes/sect x 4197405 sectors
sd1: sync (100.00ns offset 15), 8-bit (10.000MB/s) transfers

algol# disklabel sd0
# /dev/rsd0c:
type: unknown
disk: disk0
label:
flags:
bytes/sector: 512
sectors/track: 80
tracks/cylinder: 19
sectors/cylinder: 1520
cylinders: 2733
total sectors: 4154160
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:   3891200         0     4.2BSD   2048 16384 22904  # (Cyl.      0 -   
2559)
 b:    262960   3891200       swap                     # (Cyl.   2560 -   
2732)
 c:   4154160         0     unused      0     0        # (Cyl.      0 -   
2732)

I noticed that this geometry doesn't match the one given by dmesg.
Is this expected ?

Now following the guide, I zeroed sd1 and installed a label obtained
from the one above:

algol# disklabel sd1
# /dev/rsd1c:
type: unknown
disk: disk1
label:
flags:
bytes/sector: 512
sectors/track: 80
tracks/cylinder: 19
sectors/cylinder: 1520
cylinders: 2733
total sectors: 4154160
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:   4154160         0       RAID                     # (Cyl.      0 -   
2732)
 c:   4154160         0     unused      0     0        # (Cyl.      0 -   
2732)

I initialised a raid0 device with sd9 (a bogus device) and sd1:

algol# raidctl -v -s raid0
Components:
           /dev/sd9a: failed
           /dev/sd1a: optimal
No spares.
/dev/sd9a status is: failed.  Skipping label.
Component label for /dev/sd1a:
   Row: 0, Column: 1, Num Rows: 1, Num Columns: 2
   Version: 2, Serial Number: 2005010301, Mod Counter: 69
   Clean: No, Status: 0
   sectPerSU: 128, SUsPerPU: 1, SUsPerRU: 1
   Queue size: 100, blocksize: 512, numBlocks: 4153984
   RAID Level: 1
   Autoconfig: No
   Root partition: No
   Last configured as: raid0
Parity status: DIRTY
Reconstruction is 100% complete.
Parity Re-write is 100% complete.
Copyback is 100% complete.

I disklabeled raid0 with a swap area at a cylinder boundary:

algol# disklabel raid0
# raid0c:
type: RAID
disk: raid
label: default label
flags:
bytes/sector: 512
sectors/track: 128
tracks/cylinder: 8
sectors/cylinder: 1024
cylinders: 4056
total sectors: 4153984
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:   4153344         0     4.2BSD      0     0     0  # (Cyl.      0 -   
4055)
 b:       640   4153344       swap                     # (Cyl.   4056 -   
4056*)
 c:   4153984         0     unused      0     0        # (Cyl.      0 -   
4056*)

I formated /dev/raid0a

algol# newfs -O 1 /dev/raid0a

Then I tried to re-label sd1 to add a swap area matching that of raid0.
According to the guide I have to make
offset of raid0b + RF_PROTECTED_SECTORS = offset of swap within wd1
but my geometries won't allow that.

I guess I'm trying to fit a square in a circle.
What did I miss?

Regards,
Thierry.