A mount -t nfs fails with Stale file handle if the server has some stale exports entries for that client. You 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.
How do I check stale mounts in Linux?
Stale files are usually found using ls -ltR /<mounted directory path> | grep “?” , but this usually takes some time (since it goes over all files in a given path). To further clarify, the issue seen in specific files such as Java library file(s) rather than the whole mount.
How fix stale NFS mount?
How do I fix this problem? First command (umount) forcefully unmount a disk partition /mnt/local (NFS). (b) Or try to mount NFS directory with the noac option.
What causes stale NFS mounts?
I.e. What causes an NFS stale file handle error? The answer is any change in the mounted file’s underlying inode, disk device, or inode generation on the NFS server causes an NFS stale filehandle.
How do I delete a stale NFS file handle?
Specify the -f option to the umount  command to forcibly unmount a filesystem. This should be done only as a last resort, since using this option can cause data loss for open files.
What causes NFS files?
Cause. Under UNIX, if you remove a file that a currently running process still has open, the file isn’t really removed. … Once you have located and killed the process that has the file open, the . nfs file will go away automatically.
How do you unmount a stale NFS mount?
You can use umount -f -l /mnt/myfolder , and that will fix the problem.
- -f – Force unmount (in case of an unreachable NFS system). (Requires kernel 2.1. …
- -l – Lazy unmount. Detach the filesystem from the filesystem hierarchy now, and cleanup all references to the filesystem as soon as it is not busy anymore.
Why is NFS bad?
The reason is the NFS write cache, which usually does not get flushed until the file is closed. … So when a client removes a file, it will be gone for good, and the file handle is no longer valid— and and attempt to read from or write to that file will result in a “Stale file handle” error.
What is meant by stale file handle?
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 port is NFS?
NFS uses port 2049. NFSv3 and NFSv2 use the portmapper service on TCP or UDP port 111.
How do you unmount NFS mount in Linux?
Unmounting NFS File Systems
If you still have problems unmounting the share use the -l ( –lazy ) option which allows you to unmount a busy file system as soon as it is not busy anymore. If the remote NFS system is unreachable, use the -f ( –force ) option to force an unmount.
What is Exportfs in Linux?
exportfs stands for export file system, which exports file system to a remote server which can mount, and access it like a local file system. You can also unexport the directories using exportfs command.