Creating a raid 1 array with pfSense
WARNING! THIS PAGE IS NOT COMPLETE YET. WIP.
NOTE: requires snapshot RELENG_07_07_06 or better. Updated for RELEASE.
This may break your car, eat your cat, submerge your basement in water, etc. Don't blame us for damage, it's unsupported!
These instructions assume that you are using ad0 (first IDE drive and ad1 which is the second IDE drive). SCSI drives will be da0 and da1. YMMV.
- Install pfSense as you normally would (option 99 from console menu). Let it reboot. Leave LiveCD in.
- If you have already done the above, for the love of god, backup your config from Diagnostics -> Backup/Restore
- Boot into the LiveCD - we need exclusive access to the volumes
- Invoke the shell (option 8)
- Run these commands to update fstab - if your first disk is not 0 doublecheck fstab to be sure gm0 (or whatever you named your raid) is used :
# Create our mount point and mount volume
mkdir /tmp/tmp; mount /dev/ad0s1a /tmp/tmp
# Change ad to gm/mirror
sed “s%ad%mirror/gm%” /tmp/tmp/etc/fstab > /tmp/tmp/etc/fstab.new
# Move new file into place
mv /tmp/tmp/etc/fstab.new /tmp/tmp/etc/fstab
# Enable gmirror on boot
echo geom_mirror_load="YES" >> /tmp/tmp/boot/loader.conf
# We are done with volume, dismount
umount /tmp/tmp
NOTE: You can also use these types instead of round-robin, if you so wish:
- load : Read from the component with the lowest load.
- prefer : Read from the component with the biggest priority.
- round-robin : Use round-robin algorithm when choosing component to read.
- split : Split read requests, which are bigger than or equal to slice size on N pieces, where N is the number of active components.
- run the following commands to create the mirror :
# Enable footshooting
sysctl kern.geom.debugflags=16
# Tell gmirror to create raid0 array /dev/ad0 should be the disk you have the pfsense install on already.
gmirror label -v -b round-robin gm0 /dev/ad0
# Tell geome to automatically rebuild array
gmirror configure -a gm0
# Add the second disk to the mirror
gmirror insert gm0 /dev/ad1
# Wait until the mirror builds
gmirror status
# Exit when it's 100%
exit
- Reboot pfSense, remove the LiveCD, grab your feet and hope for the best.
Oh, and check out
this article∞ which goes into a little more detail.
Categories
CategoryHowTo
There are no comments on this page. [Add comment]