Error Mounting Mount Stale Nfs File Handle
Contents |
in Linux, Tips, TroubleshootingSometime NFS can result in to weird problems. For example NFS mounted directories sometimes contain stale file handles. If you run command such as ls or vi you will see an error: $ mount stale nfs file handle ubuntu ls .: Stale File Handle
First let us try to understand the concept stale nfs file handle error in linux of Stale File Handle. Managing NFS and NIS, 2nd Edition book defines filehandles as follows (a good book if youStale Nfs File Handle Solaris
would like to master NFS and NIS): 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
Stale Nfs File Handle Autofs
the object. A typical example occurs when the current directory of a process, running on your client, is removed on the server (either by a process running on the server or on another client). So this can occur if the directory is modified on the NFS server, but the directories modification time is not updated.How do I fix this problem?a) The best solution is to remount directory from stale nfs file handle redhat the NFS client using mount command: # umount -f /mnt/local
# mount -t nfs nfsserver:/path/to/share /mnt/localFirst command (umount) forcefully unmount a disk partition /mnt/local (NFS).(b) Or try to mount NFS directory with the noac option. However I don't recommend using noac option because of performance issue and Checking files on NFS filesystem referenced by file descriptors (i.e. the fcntl and ioctl families of functions) may lead to inconsistent result due to the lack of consistency check in kernel even if noac is used. Share this on:TwitterFacebookGoogle+Download PDF version Found an error/typo on this page?About the author: Vivek Gite is a seasoned sysadmin and a trainer for the Linux/Unix & shell scripting. Follow him on Twitter. OR read more like this:How do I forcefully unmount a Linux disk partition?Understanding the Linux file system directories / hierarchyRepairing Linux ext2 or ext3 or ext4 File System [ fsck ]Linux mount remote filesystems automatically at boot timeRepairing ReiserFS file system with reiserfsckApril 6, 2007: nixCraft FAQ RoundupUnderstanding UNIX / Linux File SystemSetup OpenLDAP authentication on Linux for OSX Client and sync / share homeUbuntu Linux: NFS Client Configuration To Mount NFS ShareLinux find or look for available smb shares on a server{
link, sending an email directly stale nfs file handle unix to support@esilibrary.com, or by calling us toll-free at 877-OPEN-ILS (877-673-6457), or if outside of the http://www.cyberciti.biz/tips/nfs-stale-file-handle-error-and-solution.html U.S., at 1-770-709-5555, and choosing option 2 from the automated answering system. Please note that we are a library services company, and have nothing to do with Equinox tablets or http://support.esilibrary.com/index.php?pg=kb.page&id=38 vehicles. ;-) For emergency after-hours report, please either categorize your ticket as "System Down", or leave a voice mail on the support line. Either action will page after-hours support staff. For sales or other inquiries, please visit the Contact Us section of our website, email us directly at info@esilibrary.com, or call us toll-free at 877-OPEN-ILS (877-673-6457), or if outside of the U.S., at 1-770-709-5555, and choose option 2 from the automated answering system. Thank you, -- Equinox Support Equinox depends on Help Desk Software by HelpSpot
Selection Strategies My IP Address RAID Analysis Tool Archives November 2015 October 2015 May 2015 March 2015 February 2015 January 2015 December 2014 November 2014 September 2014 August 2014 July 2014 June 2014 May 2014 March 2014 February http://joelinoff.com/blog/?p=356 2014 January 2014 December 2013 November 2013 October 2013 September 2013 May 2013 February 2013 January 2013 October 2012 September 2012 August 2012 June 2012 April 2012 March 2012 February 2012 January 2012 November 2011 October 2011 Meta Register Log in Entries RSS Comments RSS WordPress.org How to fix stale NFS mounts on linux without rebooting I have often noticed that some folks reboot systems to fix stale NFS mount stale nfs problems which can be disruptive. Fortunately, that often isn't necessary. All you have to do is restart nfs and autofs services. However that sometimes fails because user processes have files open on the stale partition or users are cd'ed to the stale partition. Both conditions are easy to fix. The steps to fix stale mounts by addressing the previously described conditions are described below. Step 1. Kill process with open stale nfs file files on the partition Use lsof to find the processes that have files open on the partition and then kill those processes using kill or pkill. Step 1. Kill Processes Shell % sudo su - % # Find the jobs that are accessing the state partition and kill them. % kill -9 $(lsof |\ egrep '/stale/fs|/export/backup' |\ awk '{print $2;}' |\ sort -fu ) % # Restart the NFS and AUTOFS services % service nfs stop % service autofs stop % service nfs start % service autofs start % # Check it % ls /stale/fs 12345678910111213141516171819202122232425 % sudo su - % # Find the jobs that are accessing the state partition and kill them.% kill -9 $(lsof |\egrep '/stale/fs|/export/backup' |\awk '{print $2;}' |\sort -fu ) % # Restart the NFS and AUTOFS services% service nfs stop% service autofs stop% service nfs start% service autofs start% # Check it% ls /stale/fs Typically this is sufficient but if it fails, you need to go to step 2. Step 2. Kill process that have cd'ed to the partition Look at the current working directory of all of the users. If any of them are on the partition, that process has to be killed. Step 2. Kill Specific Users Shell %