<Install> → <Yes> → <Keyboard Setting> → <Distribution Select> → <Shell>
umount -f /dev/md1 mdmfs -s 512M md1 /tmp
dmesg | grep MBIn following procedure, device names (e.g. ada0, ada1, ...) are denoted as deviceX.
For every devices, deviceX
gpart destroy -F deviceX
gpart create -s gpt deviceX
gpart add -s 128 -t freebsd-boot deviceX
gpart add -t freebsd-zfs -l diskX deviceX
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 deviceX
ZFS pool name: zroot
zpool create zroot raidz1 /dev/gpt/diskX /dev/gpt/diskX ...(ignore any warnings regarding mounting)
zpool set bootfs=zroot zroot zfs set checksum=fletcher4 zroot zfs set mountpoint=/mnt zroot
checksum: fletcher4 (on) : fletcher2 : sha256 : off
zpool export zroot zpool import -o cachefile=/var/tmp/zpool.cache zroot
zfs create zroot/usr zfs create zroot/usr/home zfs create zroot/var zfs create -o compression=on -o exec=on -o setuid=off zroot/tmp zfs create -o compression=lzjb -o setuid=off zroot/usr/ports zfs create -o compression=off -o exec=off -o setuid=off zroot/usr/ports/distfiles zfs create -o compression=off -o exec=off -o setuid=off zroot/usr/ports/packages zfs create -o compression=lzjb -o exec=off -o setuid=off zroot/usr/src zfs create -o compression=lzjb -o exec=off -o setuid=off zroot/var/crash zfs create -o exec=off -o setuid=off zroot/var/db zfs create -o compression=lzjb -o exec=on -o setuid=off zroot/var/db/pkg zfs create -o exec=off -o setuid=off zroot/var/empty zfs create -o compression=lzjb -o exec=off -o setuid=off zroot/var/log zfs create -o compression=gzip -o exec=off -o setuid=off zroot/var/mail zfs create -o exec=off -o setuid=off zroot/var/run zfs create -o compression=lzjb -o exec=on -o setuid=off zroot/var/tmp
lzjb (on) … for random read
(high compression ratio)
gzip-9
> gzip-6 (gzip)
> gzip-1
> off
(high speed) … for sequential read
If you have enough storage:
zfs create zroot/usr zfs create zroot/usr/home zfs create zroot/var zfs create -o exec=on -o setuid=off zroot/tmp zfs create -o setuid=off zroot/usr/ports zfs create -o exec=off -o setuid=off zroot/usr/ports/distfiles zfs create -o exec=off -o setuid=off zroot/usr/ports/packages zfs create -o exec=off -o setuid=off zroot/usr/src zfs create -o compression=lz4 -o exec=off -o setuid=off zroot/var/crash zfs create -o exec=off -o setuid=off zroot/var/db zfs create -o exec=on -o setuid=off zroot/var/db/pkg zfs create -o exec=off -o setuid=off zroot/var/empty zfs create -o compression=lz4 -o exec=off -o setuid=off zroot/var/log zfs create -o compression=gzip -o exec=off -o setuid=off zroot/var/mail zfs create -o exec=off -o setuid=off zroot/var/run zfs create -o compression=lz4 -o exec=on -o setuid=off zroot/var/tmp
zfs create -V 32G zroot/swap zfs set org.freebsd:swap=on zroot/swap zfs set checksum=off zroot/swap
chmod 1777 /mnt/tmp cd /mnt ; ln -s usr/home home chmod 1777 /mnt/var/tmp
sh cd /usr/freebsd-dist export DESTDIR=/mnt for file in base.txz lib32.txz kernel.txz doc.txz ports.txz src.txz; do (cat $file | tar --unlink -xpJf - -C ${DESTDIR:-/}); done
cp /var/tmp/zpool.cache /mnt/boot/zfs/zpool.cache
echo 'zfs_enable="YES"' >> /mnt/etc/rc.conf echo 'zfs_load="YES"' >> /mnt/boot/loader.conf echo 'vfs.root.mountfrom="zfs:zroot"' >> /mnt/boot/loader.conf touch /mnt/etc/fstab
zfs set readonly=on zroot/var/empty zfs umount -af zfs set mountpoint=legacy zroot zfs set mountpoint=/tmp zroot/tmp zfs set mountpoint=/usr zroot/usr zfs set mountpoint=/var zroot/var
zpool add zroot cache cachedev
zpool remove zroot cachedev
gpart destroy -F ndev gpart create -s gpt ndev gpart add -s 128 -t freebsd-boot ndev gpart add -t freebsd-zfs -l diskN ndev gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ndev
zpool replace zroot odevp2 ndevp2