sharing ZFS data sets via nfs (x86_64)
This issue mostly has to do with sharing ZFS data sets over nfs.
However, there is a first problem part that makes tracking down the main part more difficult.
If I make a directory to share on an ext4 partition after having created ZFS data sets and unsuccessfully sharing them, the ext4 share doesn’t work – the first time. It is impossible to mount on a client using e.g.,
sudo mount -t nfs -vvvv host_ip_address:/home/me/host_test /home/me/client_test
This command will hang forever. However, if I try to do this on the host server, e.g.,
sudo mount -t nfs -vvvv localhost:/home/me/host_test /home/me/a_test
it will succeed. Thereafter it will always succeed on the client as well. This behavior survives reboots of the host. End of first problem part.
As documented by Max Mopp and me, it is currently impossible to share a ZFS data set over nfs. Setting sharenfs=on (or any other reasonable set of options) does not work. Neither does the combination of setting sharenfs=off and manually putting the share in /etc/exports.
In both cases,
showmount -e host_ip_address
shows correct the share(s) as does the same command on the host, i.e.,
showmount -e localhost.
sudo mount -t nfs -vvvv host_ip_address:/home/me/host_zfs_share /home/me/client_zfs_share
hangs indefinitely on the client. The same command, on the host, i.e.,
sudo mount -t nfs -vvvv localhost:/home/me/host_zfs_share /home/me/test_zfs_share
also results in a hang.
File/directory permissions in all cases are me:me. Example contents of /etc/exports are:
See exports(5) for a description.
use exportfs -arv to reread
/home/me/host_zfs_share *(rw,sync,no_root_squash,no_subtree_check) /home/me/host_test *(rw,sync,no_root_squash,no_subtree_check)
I haven’t found that changing the options makes any difference. I successfully use these export options and permissions with an Ubuntu ZoL server.
It seems like there is some missing plumbing between the latest version of ZFS on Linux and nfs in Alpine Linux. I hope that this information is sufficient to give a clue as to where to start looking.