Manish Narang
Manish Narang

Reputation: 87

If there is any script or command that can check which of the NFS mounts are having problems and which aren't?

I have recently been having problems running df -h, where it just hangs?

I tried running dmesg and getting the following snipped output:

[163075.079660] nfs: server 10.52.88.225 not responding, timed out
[163255.559732] nfs: server 10.52.88.225 not responding, timed out
[163255.559746] nfs: server 10.52.88.225 not responding, timed out
[163436.039699] nfs: server 10.52.88.225 not responding, still trying
[181222.119076] Key type cifs.spnego registered
[181222.119084] Key type cifs.idmap registered
[3350628.620368] hrtimer: interrupt took 10952185 ns

And when I pinged 10.52.88.225, it is throwing "Destination Host Unreachable".

So what I am trying to achieve is giving df may be only 10 seconds and if it does not respond, then terminate and process the next one in the list. Any script can be made to do this?

Any response/feedback will be much appreciated.

Upvotes: 1

Views: 557

Answers (1)

Milag
Milag

Reputation: 1996

Try this one:

timeout [options] 10s <command> [args]

Update:

If you need to control/abort a stalled df and see output for other mounts, you may need to run 1 "df" for each mount; to keep things simple, maybe a shell script similar to this:

  • select lines from a list of mounted filesystems (eg /etc/mtab)
  • for each mount point run: timeout <short-limit> df $element

Upvotes: 1

Related Questions