Sunday, April 18, 2010

Quick Howto: Configuring Linux Auto Mounter

The Linux automounter is a great feature that allows "transparent" mounts, means you can access samba / nfs shares without actually mounting the area by yourself. Let's see how it's done:

The master configuration file is /etc/auto.master , you will not deal much with it because it simply points to other auto.* configuration files, be sure though your confguration file is listed there.
On most distro auto.misc exists by default so I will use it in this example.

I've set up an NFS share of the /nfs directory on a remote server called "prana" . I've also configured the following command in my /etc/auto.misc file on my local server:

nfs  -rw,soft,intr  prana:/nfs

We need to reload autofs configuration with:

/etc/init.d/autofs restart

Make sure your firewall configured to accept nfs connections and the relevant deamons are up and running (nfs,portmap,mountd).

Now, when accessing /misc/nfs on local server you should see the contents of the exported /nfs folder on prana.

No comments: