Sorry I’m not an avid forum user and as such I’m kinda expecting that this topic is in the wrong place, apologies for that and please tell me what to do if I can fix it.
Okay, I have an ubuntu 18.04 server with NFS file shares set up. And I have mounted these shares (over a timespan of months) using: fstab, autofs and systemd-automount. And everytime I will get a
mount.nfs: Stale file handle error
message after a while of using the share. It is driving me crazy and has forced me to switch back to samba which makes me feel like barbarian as my client is kubuntu 18.04.
Why am I getting a stale file handle error when I’m just using the fileshare and how can I fix this?
relevant mount
entry: (this seems to be the one from autofs)
192.168.20.72:/mnt/datastorev2/data/<name> on /nfs/datastorev2 type nfs4 (rw,nosuid,relatime,vers=4.2,rsize=8192,wsize=8192,namlen=255,soft,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.20.176,local_lock=none,addr=192.168.20.72,user=<name>)
relevant /etc/fstab/
configurations (of course not enabled at the same time):
192.168.20.72:/mnt/datastorev2/data/<name> /media/kaoru/datastorev2/ nfs rw,noauto,user,_netdev,bg 0 0
192.168.20.72:/mnt/datastorev2/data/<name> /media/kaoru/datastorev2/ nfs noauto,x-systemd.automount,x-systemd.device-timeout=10,timeo=14,x-systemd.idle-timeout=1min,user,vers=4 0 0
and the contents of auto.nfs
:
datastorev2 -fstype=nfs,soft,intr,rsize=8192,wsize=8192,nosuid,tcp,user=<username>,group=<user's groupname> 192.168.20.72:/mnt/datastorev2/data/<user>
and finally the hosts /etc/exports
:
mnt/datastorev2/data/<name> 192.168.20.*(rw,sync,no_subtree_check)
The datastorev2
is a ZFS of 4 disks. (twice a mirrored set of disks.)