Using any of /etc/mtab, /proc/mounts, mount, or mountpoint can give you incorrect information if any of the following have occurred:

  • The remote is offline (grep-file based solutions fail)
  • For NFS mounts, the remote has stopped exporting or the NFS service has been stopped (mountpoint fails)
  • The remote has changed IP addresses (all solutions fail)

How can I retrieve a simple yes/no answer as to whether or not the mount is usable as intended? As far as I understand, all of the mount information is stored in both /etc/mtab and in /proc/mounts. Without causing a hang (as stat does), is there a way to verify that the actual state of the network is as the local information would lead me to believe?

This needs to be a very general tool, able to handle CIFS and NFS mounts (and others, most likely).


I can only use what comes with the standard distribution on RHEL 6. Usually, everything in /bin:/sbin:/usr/bin:/usr/sbin is fair game. This is not by choice and is not a movable point, so I cannot accept an answer that uses external tools. For future readers' sake, though, I welcome them as comments :)


  • Doesn't a plain mount show the IP address/hostname of the remote system for NFS mounts? (I know it does for CIFS) grep it and then something like ping the host, which should fail faster than trying to access the remote mount.
    – LawrenceC
    Jan 14, 2015 at 0:12
  • @ultrasawblade For NFS mounts, I think so. But this may not apply to CIFS mounts, for instance. I'm not sure. Jan 14, 2015 at 2:55

2 Answers 2


I am afraid this is impossible.

The only way to find out if an NFS (or, more generally, any network) device is usable is to try to use it and that can block (and take quite some time).

Moreover, "un-usability" is not something permanent. If remote comes back up on-line, the mount becomes usable again.

  • I fear this might truly be the case, but I'll wait for more exposure before I consider the case closed -- I'm curious to see if others have come up with various hacks around the problem. I see the logic in your point, but there are ways (e.g. for NFS, rpcinfo and showmount) to make very good guesses. Jan 13, 2015 at 21:47

On Ubuntu I have created the mount points from root, but they are mounted to a different user, so checking the ownership gives me an indication of whether they were mounted or not.

All my mounts are in /media so the following script shows which have been mounted:

ls -ld /media/* |                      \
  while read x x usr grp x x x x name; \
  do if [ $usr == root ];              \
     then echo $name not mounted;      \
     else echo $name mounted;          \
     fi;                               \

If you need to mount as root, perhaps you could use a different group and check that instead.

Note that this checks that a previous mount was successful. If a mounted device or network share subsequently goes down without being dismounted, accesses to it will still hang.

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.