Installing FreeBSD 9 on Software RAID
A step-by-step guide to installing FreeBSD 9 on a software RAID using gmirror, ensuring a reliable and efficient setup.
Installing FreeBSD 9 on Software RAID
To install FreeBSD 9.x on a software RAID (gmirror), boot from a live CD. The recommended option is mfsBSD, accessible from the PXE menu. Log in using the default root password mfsroot, and manage the setup via SSH.
Step 1: Remove Existing Partitions
First, remove any existing partitions on the disks:
# Remove existing partitions
gpart destroy -F ada0
gpart destroy -F ada1
Step 2: Start bsdinstall
Begin the installation by launching bsdinstall. During the “Partitioning” dialog, select the Shell option and input the commands to create partitions and install the boot loader:
# ---- Setup 1st disk
#gpart create -s gpt ada0
#gpart add -s 64k -t freebsd-boot -l boot0 ada0
#gpart add -s 8G -t freebsd-swap -l swap0 ada0
#gpart add -t freebsd-ufs -l root0 ada0
# -- Install boot code to first disk
gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada0
# ---- Setup 2nd disk
#gpart create -s gpt ada1
#gpart add -s 64k -t freebsd-boot -l boot1 ada1
#gpart add -s 8G -t freebsd-swap -l swap1 ada1
#gpart add -t freebsd-ufs -l root1 ada1
# -- Install boot code to 2nd disk
gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada1
Inform the disk subsystem that new labels are present:
true > /dev/ada0
true > /dev/ada1
To verify that the system acknowledges your disks, use:
ls -l /dev/gpt/
Step 3: Load geom_mirror and Create RAID1
Load the module into the kernel and create a RAID1 mirror:
# -- Load the geom_mirror KLD
kldload geom_mirror
# -- Build gmirrors
'gmirror label boot /dev/gpt/boot0 /dev/gpt/boot1
'gmirror label swap /dev/gpt/swap0 /dev/gpt/swap1
'gmirror label root /dev/gpt/root0 /dev/gpt/root1
# -- Check status
gmirror status
Step 4: Create Filesystem and fstab
Now create a filesystem and mount it:
newfs -U -L root /dev/mirror/root
mount /dev/mirror/root /mnt
Create the proper fstab by editing /tmp/bsdinstall_etc/fstab:
# Device Mountpoint FStype Options Dump Pass
/dev/mirror/swap none swap sw 0 0
/dev/mirror/root / ufs rw 1 1
Step 5: Finalize Installation
Return to the installer by typing exit. When prompted in the “Manual Configuration” dialog, choose Yes to modify the system settings. Edit loader.conf to allow the gmirror module to load at boot:
# -- Ensure gmirror module loads on boot
echo 'geom_mirror_load="YES"' >> /boot/loader.conf
# -- Enable daily status reporting
echo 'daily_status_gmirror_enable="YES"' >> /etc/periodic.conf
Finally, use exit to complete the installation. Reboot, and if the process went smoothly, FreeBSD 9 will be installed on your software RAID with gmirror. Use mfsBSD for troubleshooting if needed.
This guide is adapted from notes by Adam Strohl on ateamsystems.com. Thank you!
Need Help?
Our support team is available 24/7 to assist you with any questions or issues.
Contact Support