darwin

automount

mount autofs on the appropriate mount points

automount [-v] [-c] [-t timeout]

Reads /etc/auto_master mounts autofs to cause mounts to be triggered.
Also attempts to unmount any top-level autofs mounts no longer found.

Options on command line have equivelant options in /etc/autofs.conf
-v Print more detailed information about actions taken by automount.
-c Tell automountd(8) to flush any cached information it has.
‑t timeout after which an automounted file system will be unmounted if it hasn't been referred default is 10 minutes (600 seconds).

/etc/autofs.conf configuration file for automount and automountd.

#used by automount  and automountd                  from smacker as of 1/26/08 
# seconds after which an automounted file system will be unmounted if it hasn't been referenced
# 10 minutes (600 seconds).
# -t in automount
AUTOMOUNT_TIMEOUT=3600

#-v 
#AUTOMOUNT_VERBOSE=FALSE
#AUTOMOUNTD_VERBOSE=FALSE

# disable browsing of all maps, 
#-n option to automountd
#AUTOMOUNTD_NOBROWSE=FALSE

# The trace level for logging requests received  by automountd(8) from autofs, 
# processing done for those requests, # and replies sent to autofs.  
#default 0 , 
#-T to automountd
#AUTOMOUNTD_TRACE=0

# comma-separated list of mount option defaults for mounts done by automountd. 
# The options for a particular mount can override these options. 
#-o option to  automountd
AUTOMOUNTD_MNTOPTS=nosuid,nodev

# Environment variables.  format AUTOMOUNTD_ENV=ENV=value.
# one line per environment variable 
#AUTOMOUNTD_ENV= 

/etc/auto_master directories and maps controlled by autofs

Format:

mountpoint map -options

mountpoint directory on which the map is to be mounted,
map name of the map. A map beginning with / is a file containing the map.
options comma-separated list of default mount options used by any entries in the map that do not have their own mount options.
-nobrowse for maps that have the potential to produce entries too numerous for browsing to be practical.( distinct from nobrowse used as a Mac OS X mount option, which affects the visibility of the mount to the Finder.)

+ followed by a name, indicates the name of a file or map accessible from a Directory Service source such as NIS or LDAP; the entries are included at that point in the master map. /etc/auto_master entries override network entries.
Only the first entry of a mountpoint is used.

 /shared         my_auto_shared
 +auto_master 

AUTOMOUNTER MAPS

associate directories with the locations of filesystems that are to be mounted when the directory is accessed. Map entries have the form:
 key location
These entries may be in a file, NIS or LDAP tables indexed by the key, or from output of an executable map. Frequently, the location is the name of an NFS server and the path to an exported file system, e.g.
local     mynfs:/export/local
A location can also represent multiple mounts, where each is associated with a relative path, for example:
 pkg  /data   mynfs:/export/pkg/data \
      /bin    mynfs:/export/pkg/bin  \
      /man    mynfs:/export/pkg/man 
this single entry provides access to any of three exported file systems from the server, each via its own subdirectory. Each of these sub-mounts will be done only when referenced.
A trailing backslash causes continuation, automounters reads these lines as a single map entry.

- preceeds mount options before location. For example:

 bin     -ro,nosuid  mynfs:/export/bin
Direct Map associates filesystem locations directly with directories. The entry key is the full path name of a directory. For example:
  /usr/local      eng4:/export/local
  /src            eng4:/export/src
Since the direct map as a whole isn't associated with a single directory, it is specified in the master map with a dummy directory name of /-.

Indirect Map is used where a large number of entries are to be associated with a single directory. Each map entry key is the simple name of a directory entry.

            bill    argon:/export/home/bill
           brent   depot:/export/home/brent
           guy     depot:/export/home/guy

Executable Map is an Indirect Map in a file with its execute permission set.
automounter executes the program or script, passing the key as an argument and receiving the location from stdout.
If automounter needs to enumerate map keys for a directory listing, it invokes the map with no arguments and expects a newline-separated list of keys on stdout. For example:

            #!/bin/sh
             if [ $# = 0 ]; then    # no args given, List keys
                       # ask ypcat for entries with key autoentries
                     ypcat -k auto_entries | awk '{print $1}'     
                     exit
             fi
             # Return location for arg.1
             ypmatch $1 auto_entries
If an error occurs, the executable returns a non-zero exit status and no output.

Special Maps
-fstab normally mounted on /Network/Servers. The key is the host name of a server; the contents of the map entry are generated from corresponding entries in fstab that have the net option and that specify mounts from that server. An entry of the form
server:/path unusedMountPoint fstype options 0 0
will be mounted in server/path under the mount point of the -fstab map, using the specified fstype file system type and the specified options. The mountpoint is ignored.
-hosts normally be mounted on /net. The key is the host name of an NFS* server; the contents of the map are generated from the list of file systems exported by that server. For example, a server that exports three NFS filesys- tems might have an equivalent map entry of:
myserv \ /export/home myserv:/export/home \ /export/local myserv:/export/local \ /export/pkg myserv:/export/pkg
To access the first mount, the path would be /net/myserv/export/home if the map was associated with /net.
-null This map has no entries, used to disable entries that occur later in auto_master . For example:
/shared -null +auto_master
The -null entry disables any /sharedi entry in +auto_master.
‑static mount point must be specified as /-.
The contents are generated from all entries in fstab that do not have the net option.
An fstab entry of
server:/path mountpoint fstype options rw 0 0
will generate a direct map entry of
mountpoint options server:/path

#
+auto_master        # Use directory service
/net                -hosts      -nobrowse,nosuid
/home               auto_home   -nobrowse
/Network/Servers    -fstab
/-                  -static

SEE automountd, autofs.conf autofsd(8),

Darwin May 14, 2007


automount -- automatic server mount / unmount daemon

automount [-V]] [-d] [-D type] [-1] [-tm secs][-tl secs] [-s] >[-tcp] [-m directory map -mnt directory] ...

automount is a daemon that automatically mounts network filesystems when they are first accessed and later unmounts them when they are idle.

It creates a virtual filesystem mounted at one or more places in the client's file and directory hierarchy. Potential server mount points within this virtual filesystem appear as symbolic links. Reading a symbolic link causes automount to mount the associated remote filesystem in a separate hierarchy and to return the path to the real mount point as the target of the symlink.

Each virtual filesystem created by automount is governed by a corresponding map. One or more maps and the location in the hierarchy where they are to appear may be specified on the command line with -m and -mnt:

-m directory map

is followed by a specification of the private mount directory where the actual mounts are to be established:

-mnt actual_root

Each map's hierarchy is rooted at the directory specified.

FILE MAPS

A map may be file or a special map. A file map is a file containing a list of entries of the form:

location mount_options server:path

mount_options must be a comma-separated list of options drawn from the options known to mount and mount_nfs. automount will automatically make available, at the map's mount point, the directory specified by server:path (as a symlink) which when traversed, it will mount the server in the directory specified with -mnt and return the real mount point as the result of the symlink resolution.

SPECIAL MAPS

In addition to reading files specifying mount maps, automount supports the -fstab, -static, and -nsl maps. The -fstab and -static maps are derived from fstab data (as provided by getfsent(3)).

All mounts in fstab without the net option will be made to appear at the fstab-specified location in the form of a symlink into the directory where the -static map is actually mounted (itself a directory of symlinks). For example, the entry:

server:/Network/Applications /Network/Applications nfs nosuid 0 0

and automount invocation

automount -m /automount/static -static -mnt /private/var/automount

result in a non-trigger symlink /Network/Applications pointing to /automount/static/Network/Applications which, when traversed, causes server:/Network/Applications to be mounted on /private/var/automount/Network/Applications (which would then be returned from reading the link).

All mounts with the net option will be mounted within the -fstab map's filesystem using a path of the form:

server/path

For such mounts, the path specified in the fstab entry will be ignored. For example, if the fstab database contained an entry for

polaris:/Library/Fonts

and automount was started as follows:

automount -m /Useful -fstab -mnt /private/Useful

then a symlink would appear in /Useful, /Useful/polaris/Library/Fonts, and link to /private/Useful/polaris/Library/Fonts where the filesystem is actually mounted when the symlink is traversed.

The -nsl map generates its filesystem hierarchy from information generated by NSL. NSL "neighborhoods" are presented as directories, populated by server entries.

Accessing servers in the NSL hierarchy may prompt the user for authentication.

-V Print version and host information, then quit

Thu Dec 27 19:42:11.316 resetTime: new mtime for '/' is Thu Dec 27 19:42:11.315758...
Thu Dec 27 19:42:11.372 automount version 100
Thu Dec 27 19:42:11.374 Host Info: smacker.thegermans.com darwin 0 ppc (big endian)
Thu Dec 27 19:42:11.375 Unmounting automounts
Thu Dec 27 19:42:11.376 Unmounting maps
Thu Dec 27 19:42:11.376 Hey?! vnode being deallocated is still registered?!
-m directory map Associate the specified map with the given directory. The directory will be created if it doesn't exist. map may be the name of a file, or it may be the name of a special map. See the FILE MAPS and SPECIAL MAPS sections above.
-d Run automount in debug mode. The program remains in the foreground and sends debugging information to standard output.
-D type Log debug messages for type. mount, proc, mount, select, options, nsl, or all. Multiple -D options may be specified.
-1 (digit one.) Modifies the -fstab and -static maps to do mounts "one at a time", when an actual mount point is traversed rather than mounting all mounts from a given server when the first of its mounts is referenced and mounted.
-tm secs Set the timeout for NFS mounts to secs seconds. The default value is 20 seconds. The "mnttimeo=n" mount option overrides this default.
-tl secs Set the time-to-live for NFS mounts to secs seconds. The default value is 3600 seconds. The "ttl=n" mount option overrides this default.

automount periodically checks all its mounted filesystems. If it finds any filesystems that have been idle for their associated time-to-live value, it will attempt to unmount them. An unmount will only be successful if there are no processes with open files in that filesystem. Unless -1 is specified, if one or more mounts from a given server are found to be active, any mounts from that server that were successfully unmounted will be immeadiately remounted.

Supplying a ttl value of 0 will disable this behavior and allow servers to remain mounted indefinetly.

-s Force all mounts at startup and never expire any mounts.
-tcp Mount servers using TCP if possible, otherwise using UDP (the default is to try UDP first, then TCP). Per mount_nfs(8), "-T", "TCP", or "tcp" mount options have the same effect as specifying -tcp; "-U", "UDP", or "udp" mount options force the default behavior of trying UDP first even if -tcp is specified.

To make the "trigger" symbolic links used by automount distinguishable from normal symbolic links, the sticky bit is set in the mode flags for the link. Programs which would normally traverse symbolic links can test for this bit and avoid triggering the mount. Various parts of the system, including ls(1), have been modified in this way.

SEE ALSO mount(8), mount_nfs(8) March 9, 1998

index