Is there any way to check df -k hanging for nfs mount issues?

14,513

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

Share:
14,513

Related videos on Youtube

Ezequiel
Author by

Ezequiel

Updated on September 18, 2022

Comments

  • Ezequiel
    Ezequiel almost 2 years

    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.

    • Rahul Patil
      Rahul Patil almost 11 years
      which version you are using ? there is a bug in nfs 1:1.2.6-3 which makes mount hang when using krb5*.