--- wikisrc/guide/raidframe.mdwn 2013/03/03 23:06:46 1.9 +++ wikisrc/guide/raidframe.mdwn 2013/04/23 22:59:14 1.11 @@ -1,3 +1,7 @@ +**Contents** + +[[!toc levels=3]] + # NetBSD RAIDframe ## RAIDframe Introduction @@ -363,66 +367,67 @@ use [disklabel(8)](http://netbsd.gw.com/cgi-bin/man-cgi?disklabel+8+NetBSD-5.0.1+i386) to allocate the entire second disk to the RAID-1 set. -*Tip*: The best way to ensure that Disk1/wd1 is completely empty is to 'zero' -out the first few sectors of the disk with -[dd(1)](http://netbsd.gw.com/cgi-bin/man-cgi?dd+1+NetBSD-5.0.1+i386) . This will -erase the MBR (i386) or Sun disk label (sparc64), as well as the NetBSD disk -label. If you make a mistake at any point during the RAID setup process, you can -always refer to this process to restore the disk to an empty state. - -*Note*: On sparc64, use `/dev/rwd1c` instead of `/dev/rwd1d`! - - # dd if=/dev/zero of=/dev/rwd1d bs=8k count=1 - 1+0 records in - 1+0 records out - 8192 bytes transferred in 0.003 secs (2730666 bytes/sec) - -Once this is complete, on i386, verify that both the MBR and NetBSD disk labels -are gone. On sparc64, verify that the Sun Disk label is gone as well. - -On i386: - - # fdisk /dev/rwd1d - - fdisk: primary partition table invalid, no magic in sector 0 - Disk: /dev/rwd1d - NetBSD disklabel disk geometry: - cylinders: 19386, heads: 16, sectors/track: 63 (1008 sectors/cylinder) - total sectors: 19541088 - - BIOS disk geometry: - cylinders: 1023, heads: 255, sectors/track: 63 (16065 sectors/cylinder) - total sectors: 19541088 - - Partition table: - 0: - 1: - 2: - 3: - Bootselector disabled. - - # disklabel -r wd1 - - [...snip...] - 16 partitions: - # size offset fstype [fsize bsize cpg/sgs] - c: 19541025 63 unused 0 0 # (Cyl. 0* - 19385) - d: 19541088 0 unused 0 0 # (Cyl. 0 - 19385) - -On sparc64: - - # sunlabel /dev/rwd1c - - sunlabel: bogus label on `/dev/wd1c' (bad magic number) - - # disklabel -r wd1 - - [...snip...] - 3 partitions: - # size offset fstype [fsize bsize cpg/sgs] - c: 19541088 0 unused 0 0 # (Cyl. 0 - 19385) - disklabel: boot block size 0 - disklabel: super block size 0 +*Tip*: +> The best way to ensure that Disk1/wd1 is completely empty is to 'zero' +> out the first few sectors of the disk with +> [dd(1)](http://netbsd.gw.com/cgi-bin/man-cgi?dd+1+NetBSD-5.0.1+i386) . This will +> erase the MBR (i386) or Sun disk label (sparc64), as well as the NetBSD disk +> label. If you make a mistake at any point during the RAID setup process, you can +> always refer to this process to restore the disk to an empty state. +> +> *Note*: On sparc64, use `/dev/rwd1c` instead of `/dev/rwd1d`! +> +> # dd if=/dev/zero of=/dev/rwd1d bs=8k count=1 +> 1+0 records in +> 1+0 records out +> 8192 bytes transferred in 0.003 secs (2730666 bytes/sec) +> +> Once this is complete, on i386, verify that both the MBR and NetBSD disk labels +> are gone. On sparc64, verify that the Sun Disk label is gone as well. +> +> On i386: +> +> # fdisk /dev/rwd1d +> +> fdisk: primary partition table invalid, no magic in sector 0 +> Disk: /dev/rwd1d +> NetBSD disklabel disk geometry: +> cylinders: 19386, heads: 16, sectors/track: 63 (1008 sectors/cylinder) +> total sectors: 19541088 +> +> BIOS disk geometry: +> cylinders: 1023, heads: 255, sectors/track: 63 (16065 sectors/cylinder) +> total sectors: 19541088 +> +> Partition table: +> 0: +> 1: +> 2: +> 3: +> Bootselector disabled. +> +> # disklabel -r wd1 +> +> [...snip...] +> 16 partitions: +> # size offset fstype [fsize bsize cpg/sgs] +> c: 19541025 63 unused 0 0 # (Cyl. 0* - 19385) +> d: 19541088 0 unused 0 0 # (Cyl. 0 - 19385) +> +> On sparc64: +> +> # sunlabel /dev/rwd1c +> +> sunlabel: bogus label on `/dev/wd1c' (bad magic number) +> +> # disklabel -r wd1 +> +> [...snip...] +> 3 partitions: +> # size offset fstype [fsize bsize cpg/sgs] +> c: 19541088 0 unused 0 0 # (Cyl. 0 - 19385) +> disklabel: boot block size 0 +> disklabel: super block size 0 Now that you are certain the second disk is empty, on i386 you must establish the MBR on the second disk using the values obtained from Disk0/wd0 above. We @@ -714,6 +719,9 @@ The NetBSD install now exists on the RAI mount-points in the new copy of `/etc/fstab` or the system will not come up correctly. Replace instances of `wd0` with `raid0`. + # mv /mnt/etc/fstab /mnt/etc/fstab.old + # sed 's/wd0/raid0/g' /mnt/etc/fstab.old > /mnt/etc/fstab + The swap should be unconfigured upon shutdown to avoid parity errors on the RAID device. This can be done with a simple, one-line setting in `/etc/rc.conf`.