UP | HOME

3. Setting up ZFS

Suggestions

This parts is heavily dependent on your config. I suggest reading the docs yourself and set it up based on your needs. I'm running 4 Samsung T7 SSD in a raid for pure performance, there's no redundency and a lot of people would cringe. This is a home lab and I have a large RAID-Z2 system that I make backups on so not a concern.

Misc Notes

Here's some scratch I kept while setting this up. Like I said, please read the docs. Don't copy paste below and expect it to work.

ZFS

zpool status -v
ls /mnt/zfs/
zfs create superpool/home
zfs create superpool/opt




echo zfs > /etc/modules-load.d/zfs.conf



zpool create -f -m /mnt/zfs superpool \
                  usb-Samsung_PSSD_T7_S6XANS0WA01004Y-0:0 \
                  usb-Samsung_PSSD_T7_S6XANS0WA04622L-0:0 \
                  usb-Samsung_PSSD_T7_S6XANS0W405677J-0:0 \
                  usb-Samsung_PSSD_T7_S6XANS0W400067N-0:0


[noah@supermini ~]$ zfs set acltype=posixacl superpool/home
cannot set property for 'superpool/home': permission denied
[noah@supermini ~]$ sudo zfs set acltype=posixacl superpool/home
[noah@supermini ~]$ sudo zfs set xattr=sa superpool/home
[noah@supermini ~]$ zfs set aclinherit=passthrough superpool
cannot set property for 'superpool': permission denied
[noah@supermini ~]$ sudo zfs set aclinherit=passthrough superpool
[noah@supermini ~]$ zfs set acltype=posixacl superpool
cannot set property for 'superpool': permission denied
[noah@supermini ~]$ sudo zfs set acltype=posixacl superpool
[noah@supermini ~]$ sudo zfs set xattr=sa


rsync --archive --progress /home/ /mnt/zfs/home

zfs set mountpoint=/home superpool/home
zfs set mountpoint=/opt superpool/opt

numfmt --from=iec 24G
# set ARC
emacs /etc/modprobe.d/zfs.conf
# 24G max
options zfs zfs_arc_max=25769803776
# 1G min
options zfs zfs_arc_min=1073741824


# Verify
cat /sys/module/zfs/parameters/zfs_arc_min
cat /sys/module/zfs/parameters/zfs_arc_max
arcstat
arc_summary | more
arc_summary -d | more

NFS

/etc/nfs.conf
/etc/exports

systemctl enable zfs-share.service
nfs-server.service
#systemctl enable nfsv4-server.service
#rpcbind.service
#rpcbind.socket

Users of protocol version 4 exports will probably want to mask at a
minimum both rpcbind.service and rpcbind.socket to prevent superfluous
services from running. See FS#76453. Additionally, consider masking
nfs-server.service which is pulled in for some reason as well.

# Once started
zfs set sharenfs=on superpool
zfs set sharenfs=on superpool/home
zfs set sharenfs=on superpool/opt
# Verify
showmount -e `hostname`
exportfs -v
zfs get sharenfs

# Clients
mount -t nfs -o vers=4 supermini:/home /home
mount -t nfs -o vers=4 supermini:/opt /opt

# Locks up
#supermini:/home   /home  nfs  rw,soft,_netdev,noauto,x-systemd.automount,x-systemd.mount-timeout=10,timeo=14,x-systemd.idle-timeout=1min 0 0
#supermini:/opt    /opt  nfs  r,soft,_netdev,noauto,x-systemd.automount,x-systemd.mount-timeout=10,timeo=14,x-systemd.idle-timeout=1min 0 0


supermini:/home        /home        nfs     rw,hard,vers=3  0       0
supermini:/opt    /opt    nfs     rw,hard,vers=3  0       0

Author: Noah Pavuk

Exported: 2024-11-04 Mon 12:31

Emacs 27.2 (Org mode 9.4.4)

Validate