I am using:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.2 LTS
Release: 20.04
Codename: focal
$ mate-about --version
MATE Desktop Environment 1.24.0
... as an NFS client.
I have an nfs4 share on the server; my entry in /etc/fstab
on the client is like this:
172.16.0.5:/mydata /media/user/mydata_nfs nfs4 nosuid,nodev,nofail,x-gvfs-show,rw,relatime,user,noauto,uhelper=udisks2 0 0
I have manually created the /media/user/mydata_nfs
, which at start has these permissions:
$ ls -la /media/user/
total 20
drwxr-x---+ 5 root root 4096 Jul 25 15:56 .
drwxr-xr-x 3 root root 4096 Jul 19 18:43 ..
...
drwxr-xr-x 2 user user 4096 Jul 25 12:11 mydata_nfs
The above fstab entry allows that the share is not mounted at startup, and so I manually have to click in the "file explorer" GUI (here caja
), to do so; however, once the share is mounted, the ownership (and timestamp) changes:
$ ls -la /media/user/
total 20
drwxr-x---+ 5 root root 4096 Jul 25 15:56 .
drwxr-xr-x 3 root root 4096 Jul 19 18:43 ..
...
drwxrwxrwx 6 root root 4096 Jul 29 06:15 mydata_nfs
On the NFS server, no_root_squash
is enabled; as I understand it, in that case UID/GID from client user is propagated to server, and since on server I also have user
with uid:gid of 1000:1000 (as on client), this works fine for me (when I create files, etc, inside the share from the command line on client, ownership of user
is kept on the share) - except for the mount point on client being owned by root (which causes me problems: some programs installed by snap
will not even list the share as a directory).
Also - even with the above fstab line (which requires me to mount manually), when I try to unmount from the GUI, I cannot, and I get a dialog with:
Unable to unmount mydata_nfs
Error finding object for block device 0:56
So, what I'd like to have is:
- NFS share to be automatically mounted at startup - with
user
owning the share
- Allow for user to unmount the share from the GUI
Is this possible at all - and what would be the right fstab line to have that?
Note that uid
fstab option (which otherwise does this kind of mapping for ntfs) does not work here - syslog will complain:
Jul 29 07:03:49 mypc mount[1148]: mount.nfs4: an incorrect mount option was specified
Jul 29 07:03:49 mypc kernel: [ 17.179641] nfs4: Unknown parameter 'uid'
Jul 29 07:03:49 mypc systemd[1]: media-user-mydata_nfs.mount: Mount process exited, code=exited, status=32/n/a
Jul 29 07:03:49 mypc systemd[1]: media-user-mydata_nfs.mount: Failed with result 'exit-code'.
Jul 29 07:03:49 mypc systemd[1]: Failed to mount /media/user/mydata_nfs.
Also allow_other
is unknown parameter for NFS.