SOLVED How to (manually) mount NFS on macOs Monterey

theomolenaar

Dabbler
Joined
Jun 12, 2016
Messages
43
Sorry for adding another thread to the already existing ones about how to mount an NFS share on macOS (Monterey).
I did my research and did a lot of testing but no working solutions came up.
What I'm trying to do is to manually mount an NFS share from my TrueNAS box to macOS. I do have a working NFS mount from this TrueNAS box with Ubuntu by the way. My ultimate goal is to automount the NFS share in macOS but first have a manual mount up and running. Any help is greatly appreciated ;-)
The /etc/exports on my trueNAS:
Code:
root@truenas[~]# cat /etc/exports
V4: / -sec=sys
/mnt/pool1/nfs/docker-volumes -alldirs -quiet -maproot="nfsuser":"nfsgrp" 192.168.1.55
/mnt/pool1/nfs/docker-volumes 192.168.1.13(rw,sync,no_subtree_check,insecure,anonuid=3000,anongid=3000)

The mounts on my trueNAS
Code:
root@truenas[~]# showmount -e 192.168.1.4
Exports list on 192.168.1.4:
/mnt/pool1/nfs/docker-volumes      192.168.1.55

There's no mention here of the ip 192.168.1.13. That's my macOS computer.
On my macOS I use this command to mount the NFS share manually:
sudo mount -t nfs -o vers=4,resvport,rw truenas.local:/mnt/pool1/nfs/docker-volumes /Users/theo/docker-volumes
The mount does show up in macOS but I don't have permissions:
Screenshot 2022-10-04 at 15.35.17.png
Screenshot 2022-10-04 at 15.38.33.png
Screenshot 2022-10-04 at 15.43.25.png

nfsuser and nfsgroup is what I have setup on TrueNAS.
When I check uid and gid for this user on my mac I get this. Looks okay to me.
Code:
#id 3000
uid=3000(nfsuser) gid=3000(nfsgrp) groups=3000(nfsgrp),12(everyone),61(localaccounts)


How do I fix this?
 

theomolenaar

Dabbler
Joined
Jun 12, 2016
Messages
43
I'm one little step ahead.
User theo was not a member of the group nfsgrp. Theo is the username I'm currently using on my mac. I added this user with this command on my mac:
sudo dseditgroup -o edit -a theo -t user nfsgrp
The little red no access sign on the folder icon dissappeared after remounting. But still.....I can't see any folders and don't have write access.
 

theomolenaar

Dabbler
Joined
Jun 12, 2016
Messages
43
Yes. After long hours of reading, researching and testing I have it working. In the first post in this thread I wrote about the /etc/exports file:
There's no mention here of the ip 192.168.1.13. That's my macOS computer.
So the solution was somewhere in this file.
I found this really helpful article. With examples how to write a good /etc/exports file. Not even a mention/example with export options between parentheses (rw,sync,no_subtree_check,insecure,anonuid=3000,anongid=3000). Long story short this is my new /etc/exports file:
Code:
V4: / -sec=sys
/mnt/pool1/nfs/docker-volumes -alldirs -quiet -maproot="nfsuser":"nfsgrp" 192.168.1.55
/mnt/pool1/nfs/docker-volumes -alldirs -quiet -maproot="theo":"nfsgrp" 192.168.1.13


User theo is the username I use on my mac. With uid 501 and a member of the group nfsgrp. I also created this user on TrueNAS with the same uid and groupid.
After making changes to /etc/exports reload the exports file with this;
Code:
root@truenas[~]# /etc/rc.d/mountd reload

And look at that......:cool:
Code:
root@truenas[~]# showmount -e truenas.local
Exports list on truenas.local:
/mnt/pool1/nfs/docker-volumes      192.168.1.55 192.168.1.13
 
Top