Autofs Hacking

Overview

I've been hacking the Linux automounter, autofs. Autofs will mount filesystems on demand and expire them if they are idle for more than a certain length of time.

Solaris automounter implements a /net directory which can automatically mount an entire tree of filesystems from an NFS server. This patch allows autofs to do the same, but in a more general way.  It extends autofs's existing "executable map" mechanism, by allowing them to return more than one mountpoint.  A simple script (samples/auto.net in the autofs source tree, for example) can look at an NFS server's exports, and return the appropriate output.

Updates

23 Oct 2000:

Well, after leaving it idle far too long, I've finished a burst of autofs4 updates. There are now updates for kernel modules in 2.2 and 2.4, and a new version of the autofs tools.

22nd Jan 2000:

HPA has asked me to manage getting together my changes and release them as autofs-4. See below for the current release.

9th Jan 2000:

I've been hacking this quite a bit over the Christmas holidays in preparation for 2.4. I've done work in the following areas:

Compatibility: The autofs daemon and kernel module are now fully backwards and forwards compatible. That is, an unmodified autofs 3 daemon will work normally with an autofs 4 kernel filesystem, and an autofs 4 daemon will be functionally equivalent to an autofs 3 daemon when run with an autofs 3 kernel module.

Reliability: While my previous daemon patches were pretty reliable, I've fixed a few narrow race conditions and cleaned up some issues with shutting down the daemon (it will now kill any pending mounts, for example).

Features: Current features of the new autofs:

Current Versions

Caveats

If you're using an autofs4 module in 2.2 or 2.4, you must include

alias autofs autofs4
in your modules config file (/etc/conf.modules or /etc/modules.conf).

This release is NOT compatible with the previous major release (around July 1999) of my changes. You must update both the kernel and the daemon. This was necessary to implement the v3 backwards-compatibility.

Shutdown is not very clean when the root-autofs directory is busy: the daemon exits, leaving the filesystem in catatonic state (which means it can be manually unmounted once it is no longer busy).  Plain autofs 3.1.x does the same, and the problem is basically insoluble.

If you're using 2.4.0-testX onwards, and want to use namespace bindings to do loopback local mounts, you need util-linux 2.10o or later.

Description of Changes

Kernel changes: Daemon changes:

References

autofs mailing list
Subscribe to autofs@linux.kernel.org by visiting the mailman page.
autofs ftp site
http://www.kernel.org/pub/linux/daemons/autofs
Autofs v4 testing versions are at http://www.kernel.org/pub/linux/daemons/autofs/testing-v4


Mail me any comments, suggestions,bug reports, etc...

Back to Jeremy's page
Page updated 13 Feb 2000