ZFS is an awesome filesystem. It offers snapshots, data integrity features, automatic data repair and RAID. It’s amazing. This blog post is written because I run a Proxmox cluster and I had to share a ZFS datastore within the cluster. I do not have a proper ‘shared storage’ solution, so I share the RAIDz1 pool with NFS from one Proxmox host to the other(s).

To create a ZFS datastore and share it by NFS run the following commands.

1: Create a datastore on your pool and install nfs-kernel-server

zfs create bigstor/backup

apt install nfs-kernel-server

2: If desired, set a quota to limit the size of the datastore

zfs set quota=2T bigstor/backup

3: Now share the datastore via NFS. ZFS offers a built-in feature to do this directly without doing NFS exports in config files.

zfs set sharenfs="rw=@192.168.1.0/24,subtree_check,no_root_squash" bigstor/backup

Edit the above line to reflect your situation. You can specify a single IP-address if you want to (e.g. 192.168.1.5, add more IP’s seperated by comma’s). "rw=@192.168.1.5,rw=@192.168.1.10"

Categorie├źn: LinuxTech