Subject: Re: real world netbsd raid questions
To: David Wetzel <dave@turbocat.de>
From: David Brownlee <abs@netbsd.org>
List: netbsd-help
Date: 02/28/2003 02:03:46
On Wed, 26 Feb 2003, David Wetzel wrote:

> hi folks,
>
> all my netbsd raid experience is some time ago with scsi (u2w) drives.
>
> Now, I want to build an server for about 30 (office) clients. The main
> target is data safety and the second is speed. I want to start with:
>
> 2 120.0GB Seagate Barracuda ATA V drives, NetBSD RAID 1 software raid.
>
	I've run raidframe RAID1 on a variety of IDE and SCSI boxes
	- the only i386 box I have without is my laptop :)

	There are three main options for setting it up:
	1) Small root filesystem with kernel - easiest to setup, but
	   awkward when updating kernel.
	2) Tiny non-'a' paritition at start with bootloader installed, then
	   'a' contains kernel and root filesystem as normal.
	3) Offset 'a' a little from start of disk and install bootblocks
	   contiguously at start with '-b'

	I tend to pick '3'. This is my checklist (I posted it a while back
	but have fixed a couple of typos since :)

     You can install as normal on one disk, get everything running
     and use the following to switch to RAID. I've used this on
     systems without console access, but not recommended :)

     Assuming you want to mirror wd0 and wd1.

     - Install the system normally on wd0, without setting up RAID.

     - disklabel wd1, and ensure wd1a is of type RAID and starts
       at least 100 blocks from the start of the disk (a cylinder
       is a good unit), wd1c should be identical to wd1d. You can
       raid the entire disk, or just part, using the remainder for
       less critical storage, or even swap.

     - Create /etc/raid0.conf - 'wd1p' should be an unused partition
         START array
         1 2 0

         START disks
         /dev/wd1a
         /dev/wd1p

         START layout
         128 1 1 1

         START queue
         fifo 100

     - Setup the raid
       raidctl -C /etc/raid0.conf raid0
       raidctl -I 6502 raid0         (Just need to pick a unique number)
       raidctl -i raid0              (Ignore error messages)

     - disklabel -i -I raid0
       Create at least raid0a.

     - Copy installed system from / to /mnt. Dump, pax, or tar OK.
       eg: newfs raid0a
           mount /dev/raid0a /mnt    (If separate /usr etc, newfs & mount).
       eg: 'cd / ; pax -X -rw -pe / /mnt'

     - Edit /mnt/etc/fstab and update wd0 lines to raid0.

     - /usr/mdec/installboot -b 16 /usr/mdec/biosboot.sym /dev/rwd1d

     - 'raidctl -A root raid0', then reboot. The kernel should boot
       from wd0, then automatically use raid0 as the root filesystem.

     - disklabel wd0 to match wd1. If the c: partition did not
       previously start at offset 0 you will need to use 'disklabel
       -I' (possibly twice to make sure :)

     - raidctl -a /dev/wd0a raid0

     - raidctl -F component1 raid0

     - /usr/mdec/installboot -b 16 /usr/mdec/biosboot.sym /dev/rwd0d

     - raidctl -S raid0         (wait for raid rebuild before rebooting)



-- 
		David/absolute          -- www.netbsd.org: No hype required --