Is there a good way to detect a stale NFS mount

后端 未结 7 1165
别跟我提以往
别跟我提以往 2020-12-23 15:08

I have a procedure I want to initiate only if several tests complete successfully.

One test I need is that all of my NFS mounts are alive and well.

Can I do

7条回答
  •  渐次进展
    2020-12-23 15:26

    In addition to previous answers, which hangs under some circumstances, this snippet checks all suitable mounts, kills with signal KILL, and is tested with CIFS too:

    grep -v tracefs /proc/mounts | cut -d' ' -f2 | \
      while read m; do \
        timeout --signal=KILL 1 ls -d $m > /dev/null || echo "$m"; \
      done
    

提交回复
热议问题