NFS Permission Denied

After many hours of rooting around, re-reading references, YT videos, I could not get the damned thing to mount:

failed: permission denied error.

In the end I found the issue was not my TN settings, although I know a lot more about ACL (grr). The solution was to force the client to use version 4. The client is alpine linux (3.18?).

In simple terms, it appears that the different NFS versions are dealt with differently by TN when it comes to permissions.

mount -t nfs -o vers=4 x.x.x.x:/path/folder /path/folder

The rest of its pretty standard:

  1. setting a non root user and group to own the folder
  2. maproot and mapgroup to the same non-root user

I hope this helps someone!

1 Like

In coming from Debian on WSL as the client, I was unable to mount via NFS, but could mount from another truenas box.

I suspect something went wrong in the apt get nfs-common on WSL not completing right. I’ll have to take a closer look at the error logs on the client.

So even if your server is perfect, try from a known working client to verify which end is having the problem.

root@stk-home:/home/stk# mount -v -o vers=4 truenas:/mnt/main/user/stk /mnt/apps
mount.nfs: timeout set for Wed Sep 25 11:37:28 2024
mount.nfs: trying text-based options 'vers=4.2,addr=192.168.1.115,clientaddr=192.168.170.240'
mount.nfs: mount(2): Invalid argument
mount.nfs: trying text-based options 'vers=4,minorversion=1,addr=192.168.1.115,clientaddr=192.168.170.240'
mount.nfs: mount(2): Operation not permitted
mount.nfs: Operation not permitted
root@stk-home:/home/stk#

Stab in the dark:
is /mnt/main/user/stk a dataset?

no, but you can mount folders and it works from other machines.

I’m almost sure it is because the id of the users don’t match on the two systems so id 1000 isn’t allowed to see ~stk due to permissions. but we’ll see. i’m a newbie at NFS.

If you want NFSv3 you can disable v4 on the server.
System->Services->NFS->edit->unselect NFSv4 in the dropdown box of the ‘enabled protocols’ field.