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 remove stale NFS file handle Linux?
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.
How do I know if my mount is NFS stale?
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.
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.
How do I fix NFS stale 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.
How do you unmount a stale file handle?
Detach the filesystem from the filesystem hierar- chy now, and cleanup all references to the filesystem as soon as it is not busy anymore. (Requires kernel 2.4. 11 or later.) If sudo umount -f /mnt/1 does not work, you can try sudo umount -l /mnt/1 .
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.
What are these .NFS files?
nfsXXXX are created by NFSv3 clients when a file that is currently opened on a client is deleted by that client. The client renames the file to . nfsXXXX which discourages other clients/processes from utilizing the file. The client that does the rename should delete the file once it’s been closed by the client process.
What is .NFS file in Linux?
NFS (Network File System) is a protocol allowing remote access to a filesystem through the network. All Unix systems can work with this protocol. SPECIFIC CASE Microsoft Windows and NFS Shares.
What is lazy unmount?
-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. This option allows a “busy” filesystem to be unmounted. … To perform operations on the filesystem that would be unsafe to do while mounted.
How do I uninstall NFS share?
You can remove a predefined NFS mount using the following procedures.
Removing predefined NFS mounts
- Enter the command: umount /directory/to/unmount .
- Open the /etc/filesystems file with your favorite editor.
- Find the entry for the directory you just unmounted, and then delete it.
- Save and close the file.
How do you unmount target busy?
If possible, let us locate/identify the busy process, kill that process and then unmount the samba share/ drive to minimize damage:
- lsof | grep ‘<mountpoint of /dev/sda1>’ (or whatever the mounted device is)
- pkill target_process (kills busy proc. …
- umount /dev/sda1 (or whatever the mounted device is)