Subject: Re: Getting started with RAID?
To: Paul Hoffman <phoffman@proper.com>
From: Chris Jones <chris@cjones.org>
List: netbsd-help
Date: 01/25/2001 13:12:39
Paul Hoffman <phoffman@proper.com> writes:

> Is there any documentation for how to set up RAID for a NetBSD system
> other than the man pages for raidctl?

http://www.netbsd.org/gallery/articles.html#clark-bsdtoday

...but that basically just parrots back what the man page says.

> Basically, I want to create a new system using RAID level 1, mirroring
> between two identical drives. Each drive would have the entire
> filesystem on it (/, swap, and /usr). I haven't seen any RAID choices
> in the installer, so I imagine that I have to do the initial install
> on wd0, and then use raidctl to make wd1 the mirror of wd0. Is this
> OK? Is there a better way to do it?

I've just recently done this.  Here's what I did:

* I'm installing on a 2G and a 4G drive (sd1 and sd0, respectively),
  which is generally a bad idea, performance-wise.  But I'm doing it
  anyway.  So I take the first 2G of sd0 and install NetBSD on it
  normally.  This is overkill; really, you just want a small partition
  with the bootloader and a kernel, and possibly some
  statically-linked emergency rescue binaries.

* Build a kernel with RAID in it.  Make sure you use the RAID
  autoconfigure thingy.

* Disklabel sd1 with a single sd1e partition, of type RAID.  Label sd0
  with an identically-sized sd0e, also of type RAID.

* Build /etc/raid0.conf.

* raidctl -C raid0 ; raidctl -I 01241305 raid0 ; raidctl -i raid0 ;
  raidctl -A yes raid0

* disklabel raid0, newfs the partitions, unpack tarballs, etc.

* Reboot.  It should use /dev/raid0a as root.  Make raid0a's fstab
  mount sd0a as /altroot.  Make sd0a's fstab mount raid0a as
  /realroot.

* Start using the system.  But make sure you always keep a few things
  in sync between sd0a and raid0a:  /netbsd, /netbsd.old,
  /etc/raid0.conf.

* Maybe make an emergency boot floppy with RAID-enabled /netbsd.gz on
  it.

> And, for the harder question, what if wd0 and wd1 are not identical
> hardware? What will be the reliability and performance issues?

That'll slow things down.  The real RAID people strongly discourage
this.  You also need to make sure that both of the component "devices"
(partitions, really) are the same size.

Chris

-- 
----------------------------------------------------- chris@cjones.org
Chris Jones                                           Mad scientist at large