Mount an nfs share with ownership

This is something that I’ve had some help with but it went over my head so I couldn’t implement it.

A link to the help I was given is here:

Could anyone help me in a more step by step process as to how to do this.

Just to describe my environment, I’m running Endeavour OS via KVM on top of UNRAID. I’ve been installing my games to an UNRAID nfs share but after every install I need to run sudo chown -R duncanm /MyMedia/Steam to make it available to steam to install the proton compatablility stuff.

From ArchWiki:

NFS expects the user and/or user group ID’s are the same on both the client and server. Enable NFSv4 idmapping or overrule the UID/GID manually by using anonuid / anongid together with all_squash in /etc/exports .

Edit /etc/exports on the NFS server : e. g.

/share    192.168.1.2(rw,all_squash,anonuid=1000,anongid=1001)

The UID and GID should be those of your client. You can find your corresponding values with
id -u <username> and id -g <username>; so in your case …

id -u duncanm
id -g duncanm

After this your files should theoretically be stored on the nfs server with the right ownership to begin with, so there shouldn’t be any need to change ownership after an install.

2 Likes

my current entry in /etc/exports is:

"/mnt/user/MyMedia" -async,no_subtree_check,fsid=100 *(sec=sys,rw,insecure,anongid=100,anonuid=99,all_squash)

Would this do it?

"/mnt/user/MyMedia" -async,no_subtree_check,fsid=100 *(sec=sys,rw,insecure,all_squash,anongid=1000,anonuid=1000)

uid and gid are both 1000

Edit:
Please note this doesn’t work on unraid as you have to use their nfs share interface.

Looks fine; just try it. You can always go back and try different combinations if you run into problems :grin:.
Don’t forget to restart the nfs server for the changes to take effect.

1 Like

Unfortunately that still doesn’t work.
Still getting wine: '/MyMedia/linuxgaming/Steam/steamapps/compatdata/501590/pfx' is not owned by you when I install a new game on steam and have to chown it.

Edit:
Just checked the file and on a reboot the server has changed the .conf back to the original. It’s UNRAID so looks like I’ll ask on their forums how to make it permanent.