# autofs nfs and boxes that are not up

## dan2003

Hi,

I have autofs setup on various clients to nfs mount various servers on my lan. As long as all the servers are up everything is fine.

But, if a server is down, opening a file dialog on a client causes a long hang as the nfs mount is attempted for the down server and eventually times out.

How can i reduce the timeout on the nfs mount to something more sensible, or better still get rid of the behavior where a pending mount hangs the file dialogs until it either succeeds or fails?

i have tried mounting with the timeo=nsecs option but this seems to have little or no effect.

mount -o timeo=5 host:/path /path

the above should i think cause it to timeout in 0.5 seconds time, but the mount hangs for far longer than this, close to a minute. 

I'm pretty sure this has only started happening recently and don't know what the cause is.

The more inaccessible mounts on a client the longer the dialogs hang - which can be for ages!

----------

## linear

Hmmm... 

Well, I think you might be using the wrong tool for the job.

The behavior you are seeing is as expected for NFS.  From 'man nfs':

```
timeo=n               The value in tenths of a second before sending the first

                      retransmission  after an RPC timeout.  The default value

                      is 7 tenths of a second.  After the first  timeout,  the

                      timeout is doubled after each successive timeout until a

                      maximum timeout of 60 seconds is reached or  the  enough

                      retransmissions  have  occured to cause a major timeout.

                      Then, if the filesystem is hard mounted, each new  time-

                      out  cascade  restarts at twice the initial value of the

                      previous cascade, again doubling at each retransmission.

                      The  maximum timeout is always 60 seconds.  Better over-

                      all performance may be achieved by increasing the  time-

                      out  when  mounting on a busy network, to a slow server,

                      or through several routers or gateways.
```

If you are looking for a fast-fail on a mount-on-demand operation, have you thought about using smbfs or cifs?

HTH.

----------

## Hu

The simplest course of action would be to avoid trying to mount from machines which are not up.  You can achieve this by using an autofs executable map that prints a list of available mounts.  The script can then probe to see which servers are down, and omit their offerings from its output.

----------

