| WARNING! THIS PAGE IS NOT COMPLETE YET. WIP |
NOTE: requires snapshot RELENG_07_07_06 or better. Updated for RELEASE.
NOTE: Support for gmirror is partially missing from 1.2.1 and 1.2.2. Should be fixed by the release of 1.2.3, as the libraries are back in as of snapshots 2009/02/19.
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.
mkdir /tmp/gtmp; mount /dev/ad0s1a /tmp/gtmp # Create our mount point and mount volume sed -i".bak" "s%ad%mirror/gm%" /tmp/gtmp/etc/fstab # Change ad to gm/mirror echo geom_mirror_load="YES" >> /tmp/gtmp/boot/loader.conf # Enable gmirror on boot umount /tmp/gtmp # We are done with volume, dismount
NOTE: You can also use these types instead of round-robin, if you so wish:
sysctl kern.geom.debugflags=16 # Enable footshooting gmirror label -v -b round-robin gm0 /dev/ad0 # Tell gmirror to create raid0 array /dev/ad0 - should be # the disk you have the pfsense install on already. gmirror configure -a gm0 # Tell geom to automatically rebuild array gmirror insert gm0 /dev/ad1 # Add the second disk to the mirror gmirror status # Wait until the mirror builds exit # Exit when it's 100%
If it all went right, you should see a good mirror:
# gmirror status
Name Status Components
mirror/gm0 COMPLETE ad0
ad1
Should you lose a drive, you can replace it physically and then run the following if it doesn't automatically try to rebuild:
gmirror insert gm0 /dev/ad1
If you still have trouble, you may need to make the mirror forget about the drive first:
gmirror forget gm0 /dev/ad1 gmirror insert gm0 /dev/ad1
Oh, and check out this article which goes into a little more detail.
| Here there be dragons |
If you want to make a mirror on a version of pfSense where the mirroring is missing (1.2.1 or 1.2.2), you will find that it fails on the "gmirror label" step with an error not unlike:
gmirror: Unknown command: label.
Fear not, all is not lost!
mount /dev/ad0s1a /mnt # Create our mount point and mount volume sed -i".bak" "s%ad%mirror/gm%" /mnt/etc/fstab # Change ad to gm/mirror echo geom_mirror_load="YES" >> /mnt/boot/loader.conf # Enable gmirror on boot cp /dist/lib/geom/geom_mirror.so /mnt/lib/geom/ # Copy the geom_mirror.so library to the hdd umount /mnt # We are done with volume, dismount
kldload /dist/boot/kernel/geom_mirror.ko # Load GEOM_MIRROR support sysctl kern.geom.debugflags=16 # Enable footshooting gmirror label -v -b round-robin gm0 /dev/ad0 # Tell gmirror to create raid0 array /dev/ad0 - should be # the disk you have the pfsense install on already. gmirror configure -a gm0 # Tell geom to automatically rebuild array gmirror insert gm0 /dev/ad1 # Add the second disk to the mirror gmirror status # Wait until the mirror builds exit # Exit when it's 100%
Ideas for future documentation: