How to properly mount an NFS share in Linux?
I have a Synology NAS which I use to share a shared folder on my local area network. I want to mount this folder on my Ubuntu desktop computer using NFS protocol. I managed to do this with sudo mount -t nfs4 192.168.1.69:/volume1/SERVERFOLDER /LOCALFOLDER
but there are few issues.
1. Issue: Only works with Map all users to admin
I have only managed to make the share mount and work in Ubuntu using the Map all users to admin
-option for the share. That sounds a bit dangerous to me. Is it? The NFS rules on the NAS are set as follows:
Can I make it work using no squash
?
2. Issue: Doesn't appear in the side panel of Nautilus in Ubuntu
If I mount the shared folder to /LOCALFOLDER
, it does not appear in the side panel of Nautilus in Ubuntu. I tried mounting the shared folder into ~/LOCALFOLDER
and the shared folder appeared in the side panel of Nautilus. Why is this? Is it recommendable to mount an NFS share into inside your home directory?
I would like to be able to unmount the drive by simply pressing the unmount icon in Nautilus.
3. Issue: Mounting and unmounting only work as sudo
It bugs me that I am unable to both mount and unmount the share without using sudo
. I would like to be able to do these operations as a regular user so I would not have to use my admin password at any point. Is this possible?
4. Issue: Every text file is executable
Every text file inside the mounted shared folder is executable. Why is this?
Final thoughts
The underlying issue to me seems to be that Unix permissions on my Ubuntu desktop and Synology NAS are not configured correctly. I was thinking about claiming ownership of the shared folder after it has been mounted. I don't know.
Also worth mentioning is that the option Apply default unix permissions
is selected in the NFS settings of Control Panel in DSM.
Map all users to admin
.usermod
andgroupmod
from DSM. I can now access the shared folder with no squash.root:root
. Did you manually change the ownership of the shares?