How To Mount NFS Using Autofs?

Posted on : October 2, 2011 , Last Updated on : October 14, 2016 By
| Reply More

Autofs uses the automount daemon to manage your mount points by only mounting them dynamically when they are accessed.

Autofs consults the master map configuration file /etc/auto.master to determine which mount points are defined. It then starts an automount process with the appropriate parameters for each mount point. Each line in the master map defines a mount point and a separate map file that defines the file systems to be mounted under this mount point. For example, the /etc/auto.misc file might define mount points in the /misc directory; this relationship would be defined in the /etc/auto.master file.

Each entry in auto.master has three fields. The first field is the mount point. The second field is the location of the map file and the third field is optional. The third field can contain information such as a timeout value.

For example, to mount the directory /jomlu on the remote machine at the mount point /misc/nfs_jomlu on your machine, add the following line to auto.master:

/misc /etc/auto.misc --timeout 60

Next, add the following line to /etc/auto.misc,

nfs_jomlu -rw,soft,intr,rsize=8192,wsize=8192

To start the autofs service, at a shell prompt, type the following command:

/sbin/service autofs restart


Tagged With : ,

Free Linux Ebook to Download

Leave a Reply

All comments are subject to moderation.