This problem has been driving me crazy.
I have an NFS server with NFS shares mounted on various clients. However, whenever I have to reboot the NFS server, I invariably end up with a bunch of "Stale file handle" errors on the mounts across all my clients which forces me to have to manually unmount and remount my NFS shares on the clients.
I have checked my exports on my NFS server with cat /etc/exports
and I am passing the same fsid for each NFS export across reboots.
My questions:
- How does Industry handle this problem? I have a hard time imagining sysadmins going in and manually unmounting/remounting each client or simply restarting connected clients en masse. Or is that really how this is handled? (Aside from the standard, "We never have a downtime and we never have to restart NFS servers.")
- Why does this happen? Is this because, even though the fsid may be the same, the NFS server recalculates file handles which may not be the same across reboots?
- Is there something I should be doing better in my mount config to prevent this?
/etc/fstab:
[NFSserver]:/mnt/backup /mnt/backup nfs bg,nfsvers=3,tcp 0 0
Per this post, it was suggested to add hard
and intr
mount options, but that doesn't seem to have made any difference.
- If all else fails, should I just fall back to using a bash script to monitor the mount/directory for a stale file error and have it perform a umount/mount cycle?
Thanks in advance.
-TorqueWrench