Re: zfs sharenfs woes

From: void <void_at_f-m.fm>
Date: Tue, 22 Jul 2025 14:04:14 UTC
On Tue, Jul 22, 2025 at 06:16:36AM -0700, Rick Macklem wrote:
>On Tue, Jul 22, 2025 at 6:10 AM void <void@f-m.fm> wrote:
>>
>> I have a problem getting sharenfs working. showmount -e displays an empty list.
>>
>> On the server (15-current-n278914) 192.168.1.102
>>
>> /etc/rc.conf :
>> # NFS
>> rpcbind_enable="YES"
>> nfs_server_enable="YES"
>> mountd_enable="YES"
>>
>> # zfs get sharenfs data/testnfs
>>
>> data/testnfs  sharenfs  maproot=root -alldirs -network 192.168.1.100/32 local
>>
>> in /etc/zfs/exports :
>>
>> /data/testnfs   -maproot=root -alldirs -network 192.168.1.100/32

>I would have expressed exporting to a single client by just specifying
>"192.168.1.100" instead of "-network 192.168.1.100/32", but I'm not
>sure if what you did is a problem?

I'm not sure either. If I change it to 192.168.1.100 is it still prefixed
by "-network" ?

It did work before - all this is subsequent to upgrading to main-stabweek-2025-Jul
so at this stage I'm unsure if it's something in the upgrade that's a problem or
something has changed that I've not accounted for.

>Did you look in /var/log/messages to see if mountd reports any error?
>(Such as not liking 192.168.1.100/32 above.)

mountd[97329]: mount request denied from 192.168.1.100 for /data/testnfs

On the client, 

% doas mount -t nfs 192.168.1.102:/data/testnfs /mnt
[tcp] 192.168.1.102:/data/testnfs: Permission denied

% doas showmount -e 192.168.1.102
Exports list on 192.168.1.102:

(empty)

If I set, on the server

% doas zfs set sharenfs="maproot=root -alldirs 192.168.1.100" data/testnfs

then, to make sure

% cat /etc/zfs/exports | ug testnfs
/data/testnfs -maproot=root -alldirs 192.168.1.100

then, stop everything nfsd

# service mountd stop
Stopping mountd.
Waiting for PIDS: 97329.

# service rpcbind stop
Stopping rpcbind.
Waiting for PIDS: 85322.

# service nfsd stop
Stopping nfsd.
Waiting for PIDS: 34878 35066.
#

in /var/log/messages on the server, I see

nfsd[34878]: rpcb_unset failed

Start all of nfsd it starts everything else

# service nfsd start
  NFS on reserved port only=YES
  NFSv4 is disabled
  Starting rpcbind.
  Starting mountd.
  Starting nfsd.
#

On the client:

% doas showmount -e 192.168.1.102
Exports list on 192.168.1.102:

(empty)

I ran 'zfs share -a' and also 'zfs share data/testnfs'. I see
mountd[1148]: mount request denied from 192.168.1.100 for /data/testnfs in 
'/var/log/messages' on the server

--