Install FreeBSD 11 on ZFS mirror (GPT or MBR)

Begin installation

by ross at 03:09:18 on October 25, 2016

The new installer

FreeBSD installer can create root-on-ZFS setup nowadays. It has limitations, for example, it can only use the entire disk for the FreeBSD installation.

If for some reason you can not achive what you want with the installer, you can still use the “Shell” installation mode and create custom FreeBSD system by hand. This guide will help you with that.

Boot from FreeBSD installation media.

Start installation, answer the questions until you endup on "Partitioning" screen. Choose "Shell" here.

First, lets have a look at the drives list:

# camcontrol devlist
<WDC WD800JB-00JJA0 05.01C05>      at scbus0 target 0 lun 0 (pass0,ada0)
<WDC WD360ADFD-00NLR4 21.07QR4>    at scbus1 target 0 lun 0 (pass1,ada1)
<WDC WD360ADFD-00NLR5 21.07QR5>    at scbus2 target 0 lun 0 (pass2,ada2)
<Hitachi HDS721010CLA332 JP4OA39C>  at scbus4 target 0 lun 0 (pass3,ada3)
<ASUS DRW-1814BLT 1.04>            at scbus6 target 0 lun 0 (pass4,cd0)

SATA/IDE disks usually have names like adaN and SCSI as daN. You see the correspondence of adaN devices to the particular drive. While installation do require use of correct N, we will setup our system to use labels, so if later we change SATA port of a drive nothing will break.

Here you see my old IDE drive used for backups, then two old WD Raptors 10k RPM which I will use as devices for the mirror and the 1TB Hitachi drive with one UFS2 partition on the entire drive I will mount as /share (holds various stuff not worth for mirrored /usr/home like video).

Prepare the drives

If the disks are not empty refer to this article to clear them. Or if you are going to dual boot prepare empty space for FreeBSD.

If you ever encounter "operation not permitted" error message, disable GEOM protection with the command:
sysctl kern.geom.debugflags=16


Very nice, clear tutorial.

Would this work also for installing on different ZFS layouts, like 15-drives RAIDZ3, or hierarchical vdevs, like 2x 7-drives RAIDZ2?
-- Sam
Saturday, March 11, 2017, 16:10:01