The AutoFS service in Leopard, also known as automount
, is configured by means of text files stored in /etc
and the automount
command-line utility. The standard automount
configuration also allows for local directory service lookups and thus can also be configured by using Directory Utility.
The configuration of the automounter starts with the master configuration file, /etc/auto_master
The contents of this file look like this:
# # Automounter master map # +auto_master # Use directory service /net -hosts -nobrowse,nosuid /home auto_home -nobrowse /Network/Servers -fstab /- -static
Here is a brief description of each one:
-
/net -hosts -nobrowse,nosuid
This configures automount of NFS servers in
/net
. Automounting is done for any resolvable host name (it doesn’t have to have an entry in/etc/hosts
and it’s browsable under/net
. The problem is that/net
is not linked from the sidebar in Finder, and thus not very useable except from the command-line. -
/home auto_home -nobrowse
This configures automounting of home directories via a directory service, as configured in
/etc/auto_home
. -
/Network/Servers -fstab
This line states that all mount entries defined in
/etc/fstab
should be mounted in/Network/Servers
. However, this is not entirely true as mount entries listed in/etc/fstab
have to specify an absolute mount point, or elseautomount
will complain. Since mount entries specify an absolute mount point, and it won’t be overridden byautomount
, in order to make Finder show the entries in the sidebar it is recommended that the mount point is located in a subdirectory within
/Networ/
.For example, this how my
/etc/fstab
file looks like:media:/export /Network/media nfs nosuid,nodev 0 0
-
/- -static
This entry is very similar to the previous one, but instead of using
/etc/fstab
as the source of mount entries, this one uses the local directory service instead. Entries can be configured using Directory Utility, and stored as a plist file in/var/db/dslocal/nodes/Default/mounts
.Here is an example of a file named
/var/db/dslocal/nodes/Default/mounts/media.lan:%2Fexport.plist
:<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>dir</key> <array> <string>/Network/media</string> </array> <key>generateduid</key> <array> <string>1895C8D3-7DBF-4857-8D61-04080DFA5B55</string> </array> <key>name</key> <array> <string>media.lan:/export</string> </array> <key>opts</key> <array> <string>nosuid</string> <string>nodev</string> </array> <key>vfstype</key> <array> <string>nfs</string> </array> </dict> </plist>
Reloading the automount
configuration is just as simple as running:
automount -vc
automount
will reload its configuration and will automatically mount any entry listed in /etc/fstab
. Additionally, the Finder will display an All… link in the sidebar that makes very easy to get to the automounted volumes.