Resetting Stale NFS Handles in Linux



 

 


Stale NFS handles can occur when a network failure breaks the link between the client system and the remote NFS server. This can result in errors like the ones below that were taken from /var/log/messages.

RPC: error 101 connecting to server emsnfs
RPC: error 5 connecting to server rtp-filer04a
RPC: error 512 connecting to server sjc5-netapp11b

These errors result from the NFS client’s attempts to reconnect with the server. A reboot can resolve this problem, but it is not usually necessary to reboot.

It is possible to recover from this situation without a reboot by restarting the NFS client. In Linux, this is the netfs process. Use the following steps to restart netfs.

  1. If there is an issue with the network itself and you cannot login that way, you will need to login using the console.
  2. Login as root.
  3. Issue the commands
    1. service netfs stop
    2. service network restart
    3. service netfs start

Command number 2 resets the network while ensuring that if you are logged in via SSH the network restarts seamlessly without disrupting your connection. Note also that you must be logged in as root. Logging in as yourself and using sudo to issue these commands does not seem to work.