The /etc/auto * files

From OS X Scientific Computing

Jump to: navigation, search

Contents



Using the /etc/auto_* files for automounting NFS filesystems in OS X 10.5.

This is new and sufficiently different that it took a while, and help from Apple, to figure it out.

man auto_master

to get the official skinny.



Create a directory as a mount point wherever suits you, eg:

sudo mkdir -p /my_mountpoint

Create a file /etc/auto_my_mountpoint

You can call it auto_anything , but this helps keep it simple

Put lines like the following in that file

 #
 # Automounter map for /my_mountpoint
 #
 +auto_my_mountpoint     # Use directory service

 Users  my.other.computer:/Users
 Drive1  my.other.computer:/Volumes/AnotherPartition
Drive2  my.other.computer:/Volumes/YetAnotherPartition

Edit the file /etc/auto_master

Add a line such as

/my_mountpoint         auto_my_mountpoint     -nobrowse

Restart the automounter

sudo automount -vc

Test it

cd /my_mountpoint/Users

It should now automount, and you should see this when you issue the commands

 df | grep my_mountpoint
map auto_my_mountpoint                                   0         0         0   100%    /my_mountpoint
my.other.computer:/Users                    241232080 175237776  65482304    73%    /my_mountpoint/Users

Note that there is no need to have an /etc/fstab entry in this case. The other partitions mount automatically when you cd into them.

Tweak for non-OS X filesystems

The good folks at Apple suggested I do the following to make automounts work for my linux and sun filesystems:

Change

AUTOMOUNTD_MNTOPTS=nosuid,nodev

in /etc/autofs.conf to

AUTOMOUNTD_MNTOPTS=nosuid,nodev,resvport






Back to NFS on OS X 10.5