2020-04-04

FreeBSD lean ZFS root installation to a whole disk

Boot the FreeBSD 11.2-RELEASE installer, the latest that seems to work with zfsboot, choose Live CD and login as root.
kldload zfs
sysctl vfs.zfs.min_auto_ashift=13
zpool create -O compression=lz4 -O recordsize=8K -O logbias=throughput -O atime=off -m / -R /mnt zroot ada0
(zpool set bootfs=zroot zroot)
cd /mnt
dhclient em0
fetch -o - ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/11.2-RELEASE/base.txz | tar xSf -
fetch -o - ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/11.2-RELEASE/kernel.txz | tar xSf -
cd boot
echo 'zfs_load="YES"' >> loader.conf
sysctl kern.geom.debugflags=16
dd if=zfsboot of=/dev/ada0 count=1
dd if=zfsboot of=/dev/ada0 iseek=1 oseek=1024
shutdown -r now

No comments:

Post a Comment