Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm mounting several drives in a script. Each one is sometimes unavailable, because the PC it's on is turned off, for instance. However, mount_smbfs takes a long time to fail (around 75 seconds), even with the "-o soft" option. Is there a way to speed this up?

Thinking about it, I guess a workaround would be to first ping the machine, and only attempt the mount if that succeeds. Is there an even better way?

share|improve this question
up vote 0 down vote accepted

This works as a workaround:

ping -q -c 1 -t 2 ${HOST} > /dev/null;
if [ $? -ne 0 ]; then
   echo "${HOST} is down."
   mount_smbfs ...

Where -t 2 is a 2 second timeout.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.