I am trying to setup NFS on a server. I have used NFS in the past, and not really had much problem with it, but for some reason I do in Ubuntu server 20.04.
I have added some test paths while setting it up, but they are not working as they should. I startet by adding a single /share
path to test the connection. I later changed this to /share/data
, but could not mount it for some reason. I could however still mount /share
, although this was no longer defiend in /etc/exports
. I had executed both exportfs -a
and systemctl restart nfs-kernel-server
, so I tried rebooting the server, still no luck.
I then tried adding /data/share
, and for some reason I am able to mount both /data
and /data/share
, which is definitely not the correct behaviour. The /share/data
location still does not work, although it is defined while /share
works without being defined.
So to sum up.
- /share/data is not working, but defined in exportfs.
- /share is working, but not defined in exportfs.
- /data and /data/share is working, but only /data/share is defined.
I have no idea what's wrong with this thing?
Here is some info from the server:
$ cat /etc/exports
/share/data 192.168.2.57(rw,sync,no_subtree_check)
/data/share 192.168.2.57(rw,sync,no_subtree_check)
$ exportfs -s
/share/data 192.168.2.57(rw,wdelay,root_squash,no_subtree_check,sec=sys,rw,secure,root_squash,no_all_squash)
/data/share 192.168.2.57(rw,wdelay,root_squash,no_subtree_check,sec=sys,rw,secure,root_squash,no_all_squash)
When trying to mount on the host:
$ mount 192.168.2.56:/share/data /mnt && echo mounted...
mount.nfs: access denied by server while mounting 192.168.2.56:/share/data
$ mount 192.168.2.56:/share /mnt && echo mounted...
mounted...
$ mount 192.168.2.56:/data/share /mnt && echo mounted...
mounted...
$ mount 192.168.2.56:/data /mnt && echo mounted...
mounted...