Adding new ZFS disk to FreeBSD

Useful links:
https://wiki.freebsd.org/RootOnZFS/GPTZFSBoot
https://vermaden.wordpress.com/2023/04/30/simple-freebsd-poudriere-harvester-guide

List physical disks:
# camcontrol devlist
at scbus0 target 0 lun 0 (pass0,ada0)
at scbus0 target 1 lun 0 (pass1,ada1)
at scbus1 target 0 lun 0 (pass2,ada2)

Create partition table:
# gpart destroy ada0
# gpart create -s gpt ada2
ada2 created

Create zfs partition:
# gpart add -a 1m -t freebsd-zfs -l poudriere ada2
ada2p1 added

Create pool:
# gpart show -p ada2
=> 40 125829040 ada2 GPT (60G)
40 2008 - free - (1.0M)
2048 125825024 ada2p1 freebsd-zfs (60G)
125827072 2008 - free - (1.0M)

# zpool create -o altroot=/usr/local/ poudriere ada2p1

https://www.unixtutorial.org/zfs-performance-basics-disable-atime/
Disabling atime for ZFS:
# zfs get all poudriere |grep time
poudriere atime on default
poudriere relatime off default

# zfs set atime=off poudriere
# zfs get all poudriere | grep time
poudriere atime off local
poudriere relatime off default

If not enabled:
sysrc zfs_enable="YES"
echo 'zfs_load="YES"' >> /boot/loader.conf

# zpool import poudriere
# zfs create -o mountpoint=/usr/local/poudriere poudriere/poudriere

reboot and check if the mountpoints are live

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.