Friday, August 18, 2017

NFS Stale Error 

When your NFS server is restarted, it is common for existing clients to report a "Stale NFS file handle" when accessing shared resources. This is a server issue, not a client issue as one may assume.

To resolve this, there are 2 options:

1) Refresh the server (Recommended)

The server needs to have a new registry of connected clients in the local exports table. To achieve this, just run the following command:

exportfs -f
This is described in the manual page as:

In 'new' mode, flush everything out of the kernels export table.
Any clients that are active will get new entries added by mountd when they make their next request.

2) Remount the client mount

Remounting the share can be achieved as follows:

#mount -o remount /home
The client may not let you do this if there are processes using the share. You will see an error like this:

umount.nfs: /home: device is busy
If this is the case, use fuser to see what is using the share like this:

#fuser -fvm /home/
The response may be similar to this:

root@server# fuser -fvm /home/
 USER PID ACCESS COMMAND
 /home/: root kernel mount /home root 1884 ..c.. tail

Check and kill the process and mount accordingly.



No comments:

Post a Comment