Subject: recovering a lost raidframe configuration (urgent!) on 3.0/i386
To: None <netbsd-users@netbsd.org>
From: Carl Brewer <carl@bl.echidna.id.au>
List: netbsd-users
Date: 01/20/2006 11:10:42
Hello,

I've got an i386 box running 3.0 that through a couple of unfortunate
co-incidences, has "lost" a raidframe config - it has two raid arrays,
raid0 (/ and all the OS stuff) and raid1 - /big

Due to an interuption during the build of raid1 (/big) I didn't get a
chance to set raidctl -A on it.  Sure enough, today, due to a buggy umass0
or faulty hardware, the machine reboots - and the backups are on a umass0
mounted device (USB HDD) which is now 3 days old)  and now I see this
error when trying to work with raid1 (mount it etc) :

mail# raidctl -s raid1
raidctl: ioctl (RAIDFRAME_GET_INFO) failed: Device not configured


The array was set up with the following raid1.conf :

mail# more /var/tmp/raid1.conf
START array
1 2 0

START disks
/dev/wd0a
/dev/wd1a

START layout
128 1 1 1

START queue
fifo 100



The box has production data on /big - which would normally be this :
(from fstab)
/dev/raid1a /big ffs rw,softdep 1 2

the disklabel on the raw disks is this :

6 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 a: 488397105        63       RAID                     # (Cyl.      0*-
484520)
 c: 488397105        63     unused      0     0        # (Cyl.      0*-
484520)
 d: 488397168         0     unused      0     0        # (Cyl.      0 -
484520)
 e: 488397105        63     4.2BSD      0     0     0  # (Cyl.      0*-
484520)


Firstly, I need to copy the data off it onto another disk so that it can
be used, and secondly, is there a way to recreate the RAID array without
overwriting the data on the disks?

I've tried using disklabel to give me an "f" partition with the following
values :
 f: 488397041        127     4.2BSD      0     0     0  # (Cyl.      0*-
484520)

but I just get this error when I try and mount it :

mail# mount /dev/wd0f /mnt
mount_ffs: /dev/wd0f on /mnt: incorrect super block

I figure it must be possible to get at the data on the disks - they're
mirrors, so the data's there, it's not RAID5 or anything messy like that.

Any suggestions?  This is kinda urgent, I need to get this back on-line RSN!
All the RAID doco talks about creating new arrays, and replacing failed
disks, but not how to get at data on disks in this situation.  Pointers to
doco or help much appreciated!