Stale NFS handle. Any 32 bit number can be used, but it must be unique amongst all the exported filesystems. This can be useful for NFS failover, to ensure that both servers of the failover pair use the same NFS file handles for the shared filesystem thus avoiding stale file handles after failover.
Every time I try to mount a NFS share I get this: mount -t nfs gitlab-replica-storage.blah.com:/export/registry-gitlab-prod-data-vol /mnt/testmount.nfs: Stale file handleThe problem is that I cannot umount, as it says: umount -f -l /mnt/testumount: /mnt/test: not mountedI tried checking if any process was using the mountpoint, but that is not the case.Any other alternative to troubleshoot this?As clarification:. I can mount it in another machine. I cannot mount it in another mountpoint on the affected machine. The error, ESTALE, was originally introduced to handle the situationwhere a file handle, which NFS uses to uniquely identify a file on theserver, no longer refers to a valid file on the server. This canhappen when the file is removed on the server, either by anapplication on the server, some other client accessing the server, orsometimes even by another mounted file system from the same client.The NFS server also returns this error when the file resides upon afile system which is no longer exported. Additionally, some NFSservers even change the file handle when a file is renamed, althoughthis practice is discouraged.This error occurs even if a file or directory, with the same name, isrecreated on the server without the client being aware of it. Thefile handle refers to a specific instance of a file and deleting thefile and then recreating it creates a new instance of the file.The error, ESTALE, is usually seen when cached directory informationis used to convert a pathname to a dentry/inode pair.
The informationis discovered to be out of date or stale when a subsequent operationis sent to the NFS server. A mount -t nfs fails with Stale file handle if the server has some stale exports entries for that client.Example scenario: this might happen when the server reboots without the client umounting the nfs volumes first. When the server is back and the client then umounts and tries to mount the nfs volume the server might respond with: mount.nfs: Stale file handleYou can check for this via looking at /proc/fs/nfs/exports or /proc/fs/nfsd/exports.
If there is entry for the client it might be a stale one.You can fix this via explicitly un-exporting and re-exporting the relevant exports on the server. For example to do this with all exports: # exportfs -ua# cat /proc/fs/nfs/exports# exportfs -aAfter this the client's mount -t nfs. Should succeed.Note that mount yielding ESTALE is quite different from some other system call (like open/readdir/unlink/chdir.) returning ESTALE. It's export being stale vs. A file handle being stale. A stale file handle easily happens with NFS (e.g. A client has a file handle but the file got deleted on the server).