title: Linux Shell Script: How to detect NFS Mount-point (or the Server) is dead?
body: <p>Generally on NFS Client, how to detect the <strong>Mounted-Point is no more available or DEAD from Server-end</strong>, by using the Bash Shell Script?</p>
  
  <p>Normally i do:</p>
  
  <pre><code>if ls '/var/data' 2&gt;&amp;1 | grep 'Stale file handle';
  then
     echo "failing";
  else
     echo "ok";
  fi
  </code></pre>
  
  <p>But the problem is, when especially the NFS Server is totally dead or stopped, even the, <code>ls</code> command, into that directory, at Client-side is hanged or died. Means, the script above is no more usable.</p>
  
  <p>Is there any way to detect this again please?</p>