Subject: RAID-1 and crash dumps
To: None <current-users@netbsd.org>
From: Martti Kuparinen <martti.kuparinen@iki.fi>
List: current-users
Date: 01/30/2004 19:48:19
Hi!

I'm updating our RAID-1 documenation to match -current's new tricks
but I got few problems...

I have two identical 120 GB disks on my server (NetBSD/i386 1.6ZI):

# dmesg | grep wd
wd0 at atabus0 drive 0: <IC35L120AVV207-1>
wd0: drive supports 16-sector PIO transfers, LBA48 addressing
wd0: 115 GB, 239340 cyl, 16 head, 63 sec, 512 bytes/sect x 241254720 sectors
wd0: 32-bit data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 5 (Ultra/100)
wd0(viaide0:0:0): using PIO mode 4, Ultra-DMA mode 5 (Ultra/100) (using DMA data transfers)
wd1 at atabus1 drive 0: <IC35L120AVV207-1>
wd1: drive supports 16-sector PIO transfers, LBA48 addressing
wd1: 115 GB, 239340 cyl, 16 head, 63 sec, 512 bytes/sect x 241254720 sectors
wd1: 32-bit data port
wd1: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 5 (Ultra/100)
wd1(viaide0:1:0): using PIO mode 4, Ultra-DMA mode 5 (Ultra/100) (using DMA data transfers)

I've configured RAID-1 for everything but I still have something wrong in
wd0's disklabel as a kernel crash dump will corrupt /home (raid0e).

With the configuration below, I went to DDB by pressing Ctrl+Alt+Esc and
typed sync. After reboot the raid0e had a corrupted super-block. So I
assume the crash dump overwrites raid0e's beginning.

I used the old method to calculate the real offset of raid0b

# dc
241254657	# wd0a
241254528	# raid0d
-p
129		# size of internal RAID structures

63		# offset of wd1a
129		# size of internal RAID structures
+
16777216	# size of raid1a
+p
16777408	# offset of swap within wd0

But this is wrong somehow. What am I doing wrong?

Martti


# fdisk wd0
Partition table:
0: <UNUSED>
1: <UNUSED>
2: <UNUSED>
3: NetBSD (sysid 169)
    start 63, size 241254657 (117800 MB, Cyls 0-15017/105/1), Active

# disklabel wd0
#        size    offset     fstype [fsize bsize cpg/sgs]
 a: 241254657        63       RAID                     # (Cyl.      0*- 239339)
 b:   2097152  16777408       swap                     # (Cyl.  16644*-  18724*)
 c: 241254657        63     unused      0     0        # (Cyl.      0*- 239339)
 d: 241254720         0     unused      0     0        # (Cyl.      0 - 239339)

# disklabel raid0
#        size    offset     fstype [fsize bsize cpg/sgs]
 a:  16777216         0     4.2BSD   2048 16384 27672  # (Cyl.      0 -  16383)
 b:   2097152  16777216       swap                     # (Cyl.  16384 -  18431)
 d: 241254528         0     unused      0     0        # (Cyl.      0 - 235600*)
 e: 222380160  18874368     4.2BSD   2048 16384 28856  # (Cyl.  18432 - 235600*)

# cat /etc/fstab
/dev/raid0a     /               ffs     rw      1       1
/dev/raid0b     none            swap    sw      0       0
/dev/raid0e     /home           ffs     rw      1       1
/dev/wd0b       none            swap    dp      0       0