AUTO_MASTER(5)

NAME
auto_master - auto_master and map file format

DESCRIPTION
The auto_master configuration file is used by the automount(8) command. Map files are read by the automountd(8) daemon.

AUTO_MASTER SYNTAX
The auto_master file consists of lines with two or three entries separated by whitespace and terminated by newline character:

    mountpoint map_name [-options]

mountpoint is either a fully specified path, or /-. When mountpoint is a full path, map_name must reference an indirect map. Otherwise, map_name must reference a direct map. See MAP SYNTAX below.

map_name specifies map to use. If map_name begins with -, it specifies a special map. See MAP SYNTAX below. If map_name is not a fully specified path (it does not start with /), automountd(8) will search for that name in /etc. Otherwise it will use the path as given. If the file indicated by map_name is executable, automountd(8) will assume it is an executable map. See MAP SYNTAX below. Otherwise, the file is opened and the contents parsed.

-options is an optional field that starts with - and can contain generic filesystem mount options.

The following example specifies that the /etc/auto_example indirect map will be mounted on /example.

    /example auto_example

MAP SYNTAX
Map files consist of lines with a number of entries separated by whitespace and terminated by newline character:

    key [-options] [mountpoint [-options]] location [...]

In most cases, it can be simplified to:

    key [-options] location

key is the path component used by automountd(8) to find the right map entry to use. It is also used to form the final mountpoint.

The options field, if present, must begin with -. When mounting the filesystem, options supplied to auto_master and options specified in the map entry are concatenated together. The special option fstype is used to specify filesystem type. It is not passed to the mount program as an option. Instead, it is passed as argument to mount -t. The special option nobrowse is used to disable creation of top-level directories for special and executable maps.

The optional mountpoint field is used to specify multiple mount points for a single key.

The location field specifies the filesystem to be mounted. To pass location that begins with /, prefix it with colon. For example, :/dev/cd0.

This example, when used with the auto_master example above, specifies that the NFS share 192.168.1.1:/share/example/x will be mounted on /example/x/ when any process attempts to access that mountpoint, with intr and nfsv4 mount options:

    x -intr,nfsv4 192.168.1.1:/share/example/x

Automatically mount the CD drive on access:

    cd -intr,fstype=cd9660 :/dev/cd0

SPECIAL MAPS
Special maps have names beginning with -. Supported special maps are:

-hosts
    This map queries the remote NFS server and maps exported volumes. It is traditionally mounted on /net. It enables access to files on a remote NFS server by accessing /net/nfs-server-ip/share-name/ directory, without the need for any further configuration.
-null
    This map prevents the automountd(8) from mounting anything on the mountpoint.

EXECUTABLE MAPS
If the map file specified in auto_master has execute bit set, the automountd(8) will execute it and parse the standard output instead of parsing the file contents.

INDIRECT VERSUS DIRECT MAPS
Indirect maps are referred to in auto_master by entries with a fully qualified path as a mount point, and must contain only relative paths as keys. Direct maps are referred to in auto_master by entries with /- as the mountpoint, and must contain only fully qualified paths as keys. For indirect maps, the final mount point is determined by concatenating the auto_master mountpoint with the map entry key and optional map entry mountpoint. For direct maps, the final mount point is determined by concatenating the map entry key with the optional map entry mountpoint.

The example above could be rewritten using direct map, by placing this in auto_master:

    /- auto_example

and this in /etc/auto_example map file:

    /example/x -intr,nfsv4 192.168.1.1:/share/example/x
    /example/cd -intr,fstype=cd9660 :/dev/cd0

DIRECTORY SERVICES
Both auto_master and maps may contain entries consisting of a plus sign and map name:

    +auto_master

Those entries cause automountd(8) daemon to retrieve the named map from directory services (like LDAP) and include it where the entry was.

If the file containing the map referenced in auto_master is not found, the map will be retrieved from directory services instead.

To retrieve entries from directory services, automountd(8) daemon runs /etc/autofs/include, which is usually a shell script, with map name as the only command line parameter. The script should output entries formatted according to auto_master or automounter map syntax to standard output. An example script to use LDAP is included in /etc/autofs/include_ldap. It can be symlinked to /etc/autofs/include.

FILES
/etc/auto_master
    The default location of the auto_master file.

SEE ALSO
autofs(5), automount(8), automountd(8), autounmountd(8)

AUTHORS
The auto_master configuration file functionality was developed by Edward Tomasz Napierala <trasz@FreeBSD.org> under sponsorship from the FreeBSD Foundation.