Warning - the following instructions will ravage your machine and then eat all the food in your refrigerator, and unlike the dwarves, they won't be kidding about breaking your dishes.


This is intended to give you a system that performs a legacy boot with GPT partitioning, and only uses pmbr (in the master boot record), gptzfsboot (in a 128K biosboot partition) and a large GELI container comprising the rest of your disk. A single-disk version should involve relatively obvious deviations from these instructions.

This instruction set assumes the FreeBSD 11.0 installation media, or similar. It describes a mirrored install to ada0 and ada1, but you'll of course want to substitute the correct devices throughout. It performs the correction for broken Lenovo BIOS, which you may not need.

See also UEFIandZFSandGELIbyHAND.


gpart destroy -F ada0
gpart destroy -F ada1

gpart create -s gpt ada0
gpart create -s gpt ada1

# if needed
gpart set -a lenovofix ada0
gpart set -a lenovofix ada1

gpart add -t freebsd-boot -s 128k -l boot0 ada0
gpart add -t freebsd-boot -s 128k -l boot1 ada1

# If you're not going to use a ZVOL for swap, then:
gpart add -t freebsd-swap -l swap0 -a 1m -s 8192m ada0
gpart add -t freebsd-swap -l swap1 -a 1m -s 8192m ada1

gpart add -t freebsd-zfs -l tank0 -a 1M ada0
gpart add -t freebsd-zfs -l tank1 -a 1M ada1

geli init -s 4096 -b -g gpt/tank0
geli init -s 4096 -b -g gpt/tank1

geli attach gpt/tank0
geli attach gpt/tank1

zpool create -R /mnt -O mountpoint=/ -O atime=off -O canmount=off \
    -O compression=on tank mirror gpt/tank0.eli gpt/tank1.eli
zfs create -o canmount=off -o mountpoint=none tank/ROOT
zfs create -o mountpoint=/ tank/ROOT/default
zpool set bootfs=tank/ROOT/default tank
zfs create tank/home
zfs create -o canmount=off tank/usr
zfs create tank/usr/jails
zfs create tank/usr/local
zfs create tank/usr/obj
zfs create tank/usr/src
zfs create tank/usr/ports
zfs create tank/usr/ports/distfiles
zfs create -o canmount=off tank/var
zfs create tank/var/log
zfs create tank/var/tmp
zfs create tank/tmp

ln -s /home /mnt/usr/home


When offered a post-install shell, take it, and put this stuff into the file /boot/loader.conf:

aesni_load="YES"
geom_eli_load="YES"

The following line should already be present in /boot/loader.conf:

zfs_load="YES"

And add this to /etc/rc.conf:

zfs_enable="YES"

If you're not using swap on a zvol, add this to /etc/fstab:

/dev/mirror/swap.eli none swap sw 0 0

Then run:

gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada1


CategoryZfs CategoryHowTo

MasonLoringBliss/LegacyZFSandGELI (last edited 2018-11-19 23:16:40 by MasonLoringBliss)