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 |
/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
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.key location
A location can also represent multiple mounts, where each is associated with a relative path, for example:local mynfs:/export/local
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.pkg /data mynfs:/export/pkg/data \ /bin mynfs:/export/pkg/bin \ /man mynfs:/export/pkg/man
-
preceeds mount options before location
. For example:
Direct Map associates filesystem locations directly with directories. The entry key is the full path name of a directory. For example:bin -ro,nosuid mynfs:/export/bin
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/usr/local eng4:/export/local /src eng4:/export/src
/-
.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 ex
ecute 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:
If an error occurs, the executable returns a non-zero exit status and no output.#!/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
Special Maps
-fstab |
# +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
[-V] [-d] [-D type] [-1]
[-tm secs][-tl secs] [-s] [-tcp]
[-m directory map -mnt directory] …
Daemon that automatically mounts network filesystems when they are first accessed and 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.
location mount_options server:path
All mounts in fstab without the
and
result in a non-trigger symlink
All mounts with the
For such mounts, the path specified in the fstab entry will be
ignored. For example, if the fstab database contained an entry for
and
then a symlink would appear in
The
Accessing servers in the NSL hierarchy may prompt the user for authentication.
Many of the options to
Supplying a ttl value of 0 will disable this behavior and allow servers to remain mounted indefinetly.
To make the "trigger" symbolic links used by
SEE ALSO
mount(8), mount_nfs(8)
March 9, 1998
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
-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)).
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
automount
invocation
automount -m /automount/static -static -mnt /private/var/automount
/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).
net
option will be mounted within the -fstab
map's filesystem using a path of the form:
server/path
polaris:/Library/Fonts
automount
was started as follows:
automount -m /Useful -fstab -mnt /private/Useful
/Useful, /Useful/polaris/Library/Fonts
,
and link to /private/Useful/polaris/Library/Fonts
where the filesystem is
actually mounted when the symlink is traversed.
-nsl
map generates its filesystem hierarchy from information generated by NSL. NSL "neighborhoods" are presented as directories, populated by server entries.
automount
are also options for mount
.
-V
Output 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?!
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
s are permitted
-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
timeout for NFS mounts. The default 20 seconds.
mnttimeo=n
overrides this default.
-tl secs
Set the time-to-live for NFS mounts . The default is 3600 seconds.
The -ttl=sec
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.
-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.
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.