On Fri, Mar 17, 2006 at 10:14:48AM +0100, Anthony Howe wrote:
> I've been thinking about my original question, Joachim Schipper
> suggestion concerning the use of /altroot, and hybrids there of for a
> file server for user accounts. Below are my notes thus far:
>
>
> The basics behind doing a software RAID on OpenBSD were originally
> gleaned from the following document:
>
> http://www.neverland.ch/netbsd/Mirroring.with.NetBSD-1.5.2.pdf
>
> I started with the simplest layout that would work:
<...>
> Its been suggested that there is no need to make the entire disk
> a RAID. Only those parts with critical data. Most of the binaries,
> static and/or infrequently changing files could live on non-RAID
> slices and use /altroot (see man afterboot) to backup this
> daily. So for example the following disk layout could be used:
>
>
> --wd0a---------- --wd1a-*--------
> / /altroot The ROOTBACKUP script
> /etc can be modified to
> /bin Contents of wd0a update the fstab copy
> /sbin copied to here so as to be bootable
> /usr daily. straight from wd1 in
> /bsd.raid the event wd0 dies.
>
> --wd0b---------- --wd1b-*--------
> swap swap
>
> --wd0d---------- --wd1d-*--------
> /tmp /tmp
>
> --wd0e---------- --wd1e----------
> raid0 raid0
>
> --raid0d----- --raid0d-----
> /var /var
>
>
> --raid0e----- --raid0e-----
> /home /home
>
>
>
> ---------------- ----------------
>
>
> Thus wd1a,b,d would remain idle for the most part, unless wd0 dies
> then a BIOS switch to boot from wd1 and continue with the raid in
> a degraded state until wd0 is replaced and reconstructed. However
> the contents of /altroot/etc/fstab would require changing I suspect
> so as to reference wd1 instead of wd0.
Indeed, /altroot/etc/fstab would need to be changed. This is the work of
five minutes, though, once you are on site.
For bonus points, modify /etc/daily to mount /altroot for a very short
amount of time and use sed to make the necessary modifications.
> However, something has been naging me at the back of my mind as to
> why the NetBSD paper would propose making /, swap, /tmp, and /usr
> separate RAID themselves. There are two reasons I've thought of so
> far.
>
> First is flexibility. Smaller slices are more flexible in that
> they allow for the use of disks of different sizes or unused
> slices on other disks.
>
> The second reason is stability and uptime. In the event of a disk
> failure, having /, swap, /tmp, and /usr as a RAID (one large or
> individually for flexibility), means the system can continue to
> operate in a degraded fashion without needing to reboot to switch
> root file system. The system remains up until the actual disk
> replacement is to be installed (if you don't have hot swap drive
> bays and disks).
>
> Now a more advanced RAID layout might be:
>
>
> --wd0a---------- --wd1a----------
> / (bootable) / (bootable)
> /tmp /tmp
> /usr /usr
> /var /var
>
> --wd0d---------- --wd1d----------
> raid0 (root) raid0 (root)
>
> --raid0a----- --raid0a-----
> / /
> /usr /usr
Hmm - why include / and /usr again? OpenBSD will boot just fine off a
RAID array, even a failed one, provided you can get the kernel read
somehow.
If you wish to protect from administrator failure, it would be more
efficient to keep a backup of / on wd0 and one of /usr on wd1, or
somesuch.
> --wd0e---------- --wd1e----------
> raid1 raid1
>
> --raid1b----- --raid1b-----
> swap swap
>
> --raid1d----- --raid1d-----
> /tmp /tmp
>
> --wd0g---------- --wd1g----------
> raid2 raid2
>
> --raid2e----- --raid2e-----
> /var /var
>
>
> --raid2f----- --raid2f-----
> /home /home
>
>
> ---------------- ----------------
<...>
Looks good, overall. Pick something you like and stick with it. ;-)
Joachim