Contents
How do I fix a stale NFS file handle?
Try restarting NFS first on the server and then on the clients. This may clear the file handles. Rebooting NFS servers with files opened from other servers is not recommended. This is especially problematic if the open file has been deleted on the server.
What does stale file handle mean?
A file handle becomes stale when the file or directory referenced by the handle is removed by another host/server, while our client still holds an active reference to the object file/directory.
What causes NFS stale file handle?
A filehandle becomes stale whenever the file or directory referenced by the handle is removed by another host, while your client still holds an active reference to the object. So this can occur if the directory is modified on the NFS server, but the directories modification time is not updated.
How to clear stale NFS file handles after reboot?
Try restarting NFS first on the server and then on the clients. This may clear the file handles. Rebooting NFS servers with files opened from other servers is not recommended. This is especially problematic if the open file has been deleted on the server.
Why do I get stale file handle error?
The stale file system error is telling you that this has occurred. Unmounting (force) and remounting from the client will resolve this problem IF there are no other references within the client that are retaining the handle/ID. I.e. this is a problem for processes that are running and have open file handles when you do the force unmount.
Why does NFS lock not work after a reboot?
But there is another pitfall in the NFSv3 protocol. Although you can successfully mount a NFS share using just IP addresses, the NFSv3 lock protocol internally uses hostnames. Both the client and server must know each other by the correct names, otherwise the NFS file locking and lock recovery after a reboot won’t work.
Where to find rpc.statd after a reboot?
One of these is rpc.statd, which has a key role in detecting reboots and recovering/clearing NFS locks after a reboot. These helper services may be located in random ports, and they are discovered by contacting the RPC port mapper (usually a process named rpcbind on modern Linuxes).