nfsv4 share

I'm trying to get my linux machine to mount my nfs share from freebsd 14.3. Here's what I've got:
# enable nfs and set some related vars
nfs_server_enable="YES"
nfsv4_server_enable="YES"
nfsuserid_enable="YES"
mountd_enable="YES"
rpc_lockd_enable="YES"
rpc_statd_enable="YES"
rpcbind_enable="YES"

and

vi /etc/exports
V4: /ark -maproot=root -network 192.168.1.0/24

now, after starting services:

# on server

showmount -e 192.168.1.13
Exports list on 192.168.1.13:
/ark 192.168.1.0
sudo showmount -e 192.168.1.13
Export list for 192.168.1.13:
/ark 192.168.1.0

but when I try to mount it:
sudo mount.nfs4 192.168.1.13:/ark /ark
mount.nfs4: access denied by server while mounting 192.168.1.13:/ark

but, if I just mount.nfs it:
sudo mount.nfs 192.168.1.13:/ark /ark
~ $ ls -l /ark
total 102664
...

So, it looks like it's not nfsv4?

Also, if i try to set up automounting (on the linux side):
systemctl is-enabled nfs-server
systemctl status nfs-server

sudo vi /etc/default/nfs-common
NEED_STATD=no
NEED_IDMAPD=yes

sudo vi /etc/default/nfs-kernel-server
RPCNFSDOPTS="-N 2 -N 3"
RPCMOUNTDOPTS="--manage-gids -N 2 -N 3"

sudo vi /etc/exports
/ark 192.168.1.0/255.255.255.0(rw,sync,no_subtree_check)

sudo systemctl restart nfs-kernel-server

sudo showmount -e
Export list for odin:
192.168.1.0/255.255.255.0

# test client access to nfs and git
It doesn't mount. I'm just guessing it's a mismatch v3/v4, but I'm off to see if I can track down logging on autofs... In the meantime, if you see a misconfiguration on the freebsd side, please help me out!
 
the V4 declaration specifies the nfsv4 root directory. Per the manpage:
In the following example some directories are exported as NFSv3 and
NFSv4:

V4: /wingsdl/nfsv4
/wingsdl/nfsv4/usr-ports -maproot=root -network 172.16.0.0 -mask 255.255.0.0
/wingsdl/nfsv4/clasper -maproot=root clasper

Only one V4: line is needed or allowed to declare where NFSv4 is rooted.
The other lines declare specific exported directories with their absolute
paths given in /etc/exports.

The exported directories' paths are used for both v3 and v4. However,
they are interpreted differently for v3 and v4. A client mount command
for usr-ports would use the server-absolute name when using nfsv3:

mount server:/wingsdl/nfsv4/usr-ports /mnt/tmp

A mount command using NFSv4 would use the path relative to the NFSv4
root:

mount server:/usr-ports /mnt/tmp

This also differentiates which version you want if the client can do both
v3 and v4. The former will only ever do a v3 mount and the latter will
only ever do a v4 mount.
So it seems to us that you should be trying mount.nfs4 192.168.1.13:/some_path_under_ark /mnt
 
For V4 I only use this in my /etc/rc.conf:

Code:
## NFSv4
   nfs_server_enable="YES"
   nfsv4_server_enable="YES"

and /etc/exports:

Code:
V4: / -network=192.168.1.0/24
/hyperion    -alldirs -maproot=root -network=192.168.1.0/24
 
the V4 declaration specifies the nfsv4 root directory. Per the manpage:

So it seems to us that you should be trying mount.nfs4 192.168.1.13:/some_path_under_ark /mnt
just to be clear, it mounts with mount.nfs just not mount.nfs4
 
Back
Top