---
name: "auto_master"
section: "5"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd", "macos"]
url: "https://new.carta.tech/auto_master"
---

# auto\_master(5)

autofs automounter configuration and map file format

## NAME

**auto\_master** – autofs automounter configuration and map file format

## DESCRIPTION

The automounter configuration consists of the **auto\_master** configuration file, which assigns filesystem paths to map names, and maps, which contain actual mount information. The **auto\_master** configuration file is used by the [automount(8)](/automount/8.md) command. Map files are read by the [automountd(8)](/automountd/8.md) 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)](/automountd/8.md) 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)](/automountd/8.md) 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)](/automountd/8.md) to find the right map entry to use. It is also used to form the final mountpoint. A wildcard (‘\*’) can be used for the key. It matches every directory that does not match other keys. Those directories will not be visible to the user until accessed.

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 an argument to **mount -t**. The default fstype is ‘nfs’. 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. Ampersands (‘&’) in the *location* field are replaced with the value of *key*. This is typically used with wildcards, like:

```
* 192.168.1.1:/share/&
```

The *location* field may contain references to variables, like:

```
sys 192.168.1.1:/sys/${OSNAME}
```

Defined variables are:

- ARCH

  Expands to the output of uname -p.

- CPU

  Same as ARCH.

- DOLLAR

  A literal $ sign.

- HOST

  Expands to the output of uname -n.

- OSNAME

  Expands to the output of uname -s.

- OSREL

  Expands to the output of uname -r.

- OSVERS

  Expands to the output of uname -v.

Additional variables can be defined with the **-D** option of [automount(8)](/automount/8.md) and [automountd(8)](/automountd/8.md).

To pass a location that begins with /, prefix it with a colon. For example, :/dev/cd0.

This example, when put into */etc/auto\_example*, and with **auto\_master** referring to the map as described 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, described in [mount\_nfs(8)](/mount_nfs/8.md):

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

Automatically mount an SMB share on access, as a guest user, without prompting for a password:

```
share -fstype=smbfs,-N ://@server/share
```

Automatically mount the CD drive on access:

```
cd -fstype=cd9660 :/dev/cd0
```

## SPECIAL MAPS

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

- \-hosts

  Query the remote NFS server and map exported shares. This map is traditionally mounted on */net*. Access to files on a remote NFS server is provided through the /net/*nfs-server-ip*/*share-name*/ directory without any additional configuration. Directories for individual NFS servers are not present until the first access, when they are automatically created.

- \-media

  Query devices that are not yet mounted, but contain valid filesystems. Generally used to access files on removable media.

- \-noauto

  Mount filesystems configured in [fstab(5)](/fstab/5.md) as "noauto". This needs to be set up as a direct map.

- \-null

  Prevent [automountd(8)](/automountd/8.md) from mounting anything on the mountpoint.

It is possible to add custom special maps by adding them, as executable maps named *special\_foo*, to the */etc/autofs/* directory.

## EXECUTABLE MAPS

If the map file specified in **auto\_master** has the execute bit set, [automountd(8)](/automountd/8.md) will execute it and parse the standard output instead of parsing the file contents. When called without command line arguments, the executable is expected to output a list of available map keys separated by newline characters. Otherwise, the executable will be called with a key name as a command line argument. Output from the executable is expected to be the entry for that key, not including the key itself.

## 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/share -fstype=smbfs,-N ://@server/share
/example/cd -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)](/automountd/8.md) 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)](/automountd/8.md) 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.

- */etc/autofs/*

  Directory containing shell scripts to implement special maps and directory services.

## SEE ALSO

[autofs(4)](/autofs/4.md), [automount(8)](/automount/8.md), [automountd(8)](/automountd/8.md), [autounmountd(8)](/autounmountd/8.md)

## AUTHORS

The **auto\_master** configuration file functionality was developed by Edward Tomasz Napierala ⟨*trasz@FreeBSD.org*⟩ under sponsorship from the FreeBSD Foundation.
