I am trying to write a script for such failure scenarios.

In a scenario where maybe, if remote connection is lost, df waits for the remote server to respond (looks like df is hanging). I know I could do a timeout after waiting for some seconds but is there any other way to check that df is hanging and kill it.

Also can I find out which mount point is causing the problem? So that I could try to unmount and mount it again.

  • which version you are using ? there is a bug in nfs 1:1.2.6-3 which makes mount hang when using krb5*. Aug 29 '13 at 11:31

Make sure following line to /etc/fstab:

nfs-server:/   /mnt   nfs4    _netdev,auto  0  0

About _netdev:

where the auto option mounts on startup and the _netdev option can be used by scripts to mount the filesystem when the network is available. Under NFSv3 (type nfs) the _netdev option will tell the system to wait to mount until the network is available. With a type of nfs4 this option is ignored, but can be used with mount -O _netdev in scripts later

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.