I have some Ubuntu file server that is connected to several NFS disks. Due to some earthquake, some NFS disks became unresponsive. This results in the df
command hanging forever. Is it possible to use df
when some of the NFS disks are unresponsive? E.g., by specifying some timeout (such as: "if disk x doesn't respond within y second, skip").
df -x nfs
will list all non-NFS file systems (or-x nfs4
if you’re using v4).df
or something else to list all the mounted disks and indicate available/used space for each of them. If some disks are unresponsive, then it should state so or at worse, skip it.alias dflocal='df -x nfs4 -x cifs'
. Actually, the version I use also has-x tmpfs -x devtmpfs
because most of the time I'm not interested in /run, /dev, /dev/shm, /run/lock or other tmpfs mounts. if I used other kinds of network filesystems, I'd add them to the alias too.mount
, doing onedf
call per fs with a timeout attached. i'm not in a place to set up a test, nor am i even sure it would work since the-x nfs
flag isn't enough to prevent the hang, but it might be worth looking into?