Re: autofs help

Steven N. Hirsch (shirsch@ibm.net)
Thu, 17 Apr 1997 06:01:33 -0400 (EDT)


On Thu, 17 Apr 1997, B. James Phillippe wrote:

> Greets,
>
> I'd like to start using (and testing) the autofs feature of the
> new 2.1 kernels. I built my kernel (2.1.35) with module support for autofs,
> and got the autofs tools from linux.kernel.org. The one problem I'm
> having, is ... how do you use it? I closely examined the rc.automount
> example script (for starting it), and it made perfect sense. But the
> options "dir" "map_type" and "[args]" that automount expects are unclear
> to me. I don't need hand-holding, but a sample script (with comments :)
> would be very much appreciated. I'm a veteran of amd and would to love to
> kick it the hell off my hard drive (at work too; it sucks like nobody's
> business).

My sincerest sympathies for your plight! I went through this exact
exercise last weekend...

A few comments to get you going:

autofs does not support any of the token expansion features you may be
used to in amd, e.g. "*" and "$key". You must explicitly name mount
point, host and target directory for mounting in each statement.

autofs does not (as of now) timeout any mount.

The init script is completely broken on my box - your milage may vary.

autofs does not use the "real mount point" plus symlink paradigm of amd.

Now, what you want is an NIS-exported map in this format:

host host.domain:directory
...

For example, in my setup I want the root directory of "cy" to appear as
"/net/cy" on the client machine. The map looks like:

cy cy.steve.net:/

I named this map "auto.master" (choose your favorite name) and export it
from the NIS server. Then start autofs on the client by:

$ automount /net yp auto.master

Nothing will happen until a direct reference (or symlink dereference) is
made against anything under /net/cy - at which point the target will
automagically appear as that name.

At this point you've gone as far as possible with the current state of the
code.

Be aware that automount execs 'mount' to do the dirty-work, so make sure
you have the latest/greatest version (2.6c?) on line. I submitted a small
patch to hpa which adds the rsize and wsize options to the mount
invocation. It has yet to appear, but I'd be glad to mail it on request.

There is also some sort of support for expansion of the "&" character into
the "key" name. It does not work for me, however, and I haven't had the
time to pursue it yet. The "local" mount feature exists as well, but as
with amd, I've yet to see a concrete example of how one would actually use
it :-(.

Good luck!

Steve