colinrmitchell.com

Blog

Setting up a RAID boot mirror on FreeBSD

Posted Monday, May 9th 2011 in FreeBSD - Permalink

To set up a RAID mirror for the root directory on FreeBSD, the first thing to do is enable mirroring. This is a kernel module and can be loaded at boot time. Edit /boot/loader.conf and add

geom_mirror_enable="YES"

Now insert a Live Filesystem disc. When the Fixit# prompt comes up, create the array:

Fixit# gmirror label -v mirror /dev/ad4

where “mirror” is the name of the mirror, and “/dev/ad4/ is the name of the original disk that you want to mirror. Now, we need to mount the mirror and tell FreeBSD where to look for the root directory. First, mount the drive,

Fixit# mount -t ufs /dev/ad4s1a

After it mounts, edit /etc/fstab and rename the drives to use your new mirror. The drives will be in the /dev/mirror directory and will be suffixed as they were before. E.g., ad4s1a becomes mirrors1a using the above convention.

Now, reboot. You should be back to your install. You can check to see that it worked,

# gmirror status


List Posts Newest Posts Page 1Next Page