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 else automount will complain. Since mount entries specify an absolute mount point, and it won’t be overridden by automount, 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.


4 Comments to “Leopard, NFS, Automounter and Finder”  

  1. 1 Federico

    Are you able to write as user and use NFS volumes as Time Machine backup volumes?

    Thanks,

    Federico

  2. 2 Felipe Alfaro Solana

    Honestly, I didn’t try too hard but it didn’t work for me. It seems NFS is unsupported at the moment due to the semantics required by Time Machine (it might work using AFP instead).

  3. 3 Leinad

    Hola Felipe lei tu articulo y me parecio interesante y creo que seria de gran ayuda para mi problema, ya que estoy tratando de configurar un server para usarlo como home para un grupo de estudiantes la cual tiene como direccin /Volumes/NFS/home , el choque comenzo en el momento que instale leopard y no encontre el netinfo. leyendo el articulo me perdi por que en mi /etc no existe un fstab si no un fstab.hd que no tiene nada y tiene los 3 auto_home, auto… los cuales no se ni como empezar a modificarlos, podrias ayudarme a solucionar mi problema.

    Gracias por la info!!!

  4. 4 jack

    automount map entries for local files do not seem to work.
    For example:
    /u :/Users/
    or
    * :/Users/&

    this seems to work fine on Linux (2.6)

    The idea is to trigger a local redirect.
    Any ideas ??
    thanks in advance !!

    -jack

Leave a Reply