NFS Automounter Configuration by SuSE 11.2

Automounter Configuration

When you use the method described in “NFS Client Configuration" on page 27 to mount home directories, all home directories on the server are visible on the client machines. This can make it quite hard for a user to find his own home directory. With the automounter, only the directory needed by a user is mounted.

Another advantage of the automounter is the reduced number of actual mounts on the server, as only those directories get mounted by clients that are actually needed.

Unlike with a static configuration in the /etc/fstab file, with the automounter,

directories are mounted automatically when needed and unmounted automatically

when not in use for some time.

The kernel-based automounter is contained in the autofs package which is part of the

default installation.

In the past, the automounter was also used to mount and unmount CD-ROMs;

however, this functionality is now integrated into the KDE or Gnome desktop

environments. The automounter remains very useful to mount and unmount

directories that are exported by file servers.

The automounter configuration consists of the general /etc/auto.master file

and files that are referenced within /etc/auto.master, such as /etc/

auto.home.

To mount the home directories exported from another server, you need the following

entry in the /etc/auto.master file:

/home /etc/auto.home

The first column lists the mount point and the second column lists the file that

contains the configuration details for this mount point.

The /etc/auto.home file could look like the following (for NFSv4 the fstype

would be nfs4):

geeko -fstype=nfs,rw da1.digitalairlines.com:/home/geeko

As soon as some process accesses the local /home/geeko directory (the entry in

the first column, geeko, is appended to the directory given in the first column in the

/etc/auto.master file, /home), the local /home/geeko directory is created

and the /home/geeko directory from the server (last column) is mounted. After

some time or when the automounter is stopped, the remote directory is unmounted

and the mount point (/home/geeko in the example above) is deleted.

With several users, you would need an entry for each user. This is cumbersome, but

might be your only choice if home directories reside on several servers.

As long as all users have their home directories on one server, the automounter allows

you to simplify the configuration with the use of wildcards, as shown in the

following:

* -fstype=nfs,rw da1.digitalairlines.com:/home/&

The “*" in the first column denotes any directory below /home. The “&" in the last

column is replaced by whatever directory is accessed.

When the automounter configuration is complete, you start the automounter with

rcautofs start. To stop the automounter, use rcautofs stop. The

chkconfig autofs on command ensures the automounter is started

automatically when the system boots.

The following commands highlight how the automounter works:

When using NFS to import home directories, it is advisable to also use a networkbased

user database, like NIS or LDAP. This ensures that a user has the same UID no

matter where he logs in within the network.

Instead of local map files, it is also possible to use NIS (Network Information

System) or LDAP to distribute the automounter information