2

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:

NFS rules.

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.

10
  • Why is it that for example I am able to both mount and unmount an SMB share via the "eject"-icon in Nautilus without elevated priviledges? Or unmount a USB thumb drive?
    – Ratatosk
    Commented Apr 1, 2020 at 16:57
  • I presume that by "it only works with..." you're referring to permissions issues rather than mount errors or anything else?
    – Attie
    Commented Apr 1, 2020 at 21:10
  • I guess they are permission issues. It mounts but I am unable to access anything in the share unless Squash is set to Map all users to admin.
    – Ratatosk
    Commented Apr 1, 2020 at 21:12
  • If anyone's interested, I managed to partially solve these issues. I guess to someone more experiences with Linux this solution might've been obvious. I managed to work my way around the squash-issue by setting the UID and GID of my Ubuntu's user to the same as the owner of the shared folder on the NAS. Synology's operating system Diskstation Manager (DSM) does not allow you to change UID and GID of a user as they have removed usermod and groupmod from DSM. I can now access the shared folder with no squash.
    – Ratatosk
    Commented Apr 5, 2020 at 9:48
  • On my Synology the shared folders were created with owner/group of root:root. Did you manually change the ownership of the shares?
    – ghr
    Commented May 11, 2020 at 20:19

0

You must log in to answer this question.

Browse other questions tagged .