Hi,
I run 3.14.0_alpha20210212 with 5.10.31-0-lts #1-Alpine SMP x86_64 Linux
and have a problem sharing zfs filesystems via nfs. My test setting:
1. nfs sharing a ext4 directory works:
/etc/exports
# /etc/exports
#
# See exports(5) for a description.
# use exportfs -arv to reread
/home/share/test2 *(sync,rw,no_subtree_check,insecure)
exportfs -arv
mount -t nfs -s -v localhost:/home/share/test2 /mnt/test2
ls /mnt/test2/
test.txt
2. sharing a zfs fs does not:
I create to diskimages, pool and fs:
dd if=/dev/zero of=/home/zfsdisks/disk1 bs=4096 count=100000
dd if=/dev/zero of=/home/zfsdisks/disk2 bs=4096 count=100000
zpool create -o ashift=12 -O compression=on -fm /home/share/test1 test1
mirror /home/zfsdisks/disk1 /home/zfsdisks/disk2
zpool status
pool: test1
state: ONLINE
config:
NAME STATE READ WRITE CKSUM
test1 ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
/home/zfsdisks/disk1 ONLINE 0 0 0
/home/zfsdisks/disk2 ONLINE 0 0 0
errors: No known data errors
zfs create test1/testfs
echo "iwashere" > /home/share/test1/testfs/file.txt
zfs set canmount=on test1/testfs
zfs set sharenfs="rw=*,insecure" test1/testfs
cat /etc/exports.d/zfs.exports
# !!! DO NOT EDIT THIS FILE MANUALLY !!!
/home/share/test1/testfs
*(sec=sys,rw,no_subtree_check,mountpoint,insecure)
rc-service nfs restart
mount -t nfs -s -v localhost:/home/share/test1/testfs /mnt/test1
... never returns
no logs no errors, no mount
Same on x86_64 stable
the same does work an arch linux (endevouros)
anybody an idea what is wrong here?
Thanks
I also have this problem.
uname -a
Linux s8 5.10.16-0-lts #1-Alpine SMP Wed, 17 Feb 2021 08:17:06 UTC x86_64 Linux
In addition to the approach that max.m.mopp took, I also tried exporting the non-ZFS way, that is:
zfs set sharenfs=off dataset
Then, create an export in /etc/exports. And,
exportfs -ra
This also does not work. However, unlike the ZFS way of creating shares there is a difference.
When I try to create nfs shares the ZFS way and then run
showmount -e server_address
on a client, I get a null response. If I try exporting the non-ZFS way and run the above command on the client, the desired shares are shown.
However, when the following command is run on the client,
sudo mount -t nfs -vvvv server_address:/home/myhome/myshare
the command hangs. There is no response, even after tens of minutes. (Note, the share is already configured in fstab.)
Seems like some plumbing between nfs and ZFS got lost along the way.
Any help would be extremely well received.
Thanks.
John