Author Topic: Automount NFS shares using autofs  (Read 418 times)

Offline tilaloz

  • Jr. Member
  • **
  • Posts: 25
Automount NFS shares using autofs
« on: August 28, 2012, 10:20:32 PM »
Motivation:
I want to use autofs to automount NFS shares. One advantage to automounting is some network drives may not be available all of the time (e.g., Network Attached Storage over wireless) and can be problematic if added to /etc/fstab.

Assumption:
There is already a configured and working NFS server on your network. There are several tutorials for this and most NAS come pre-configured with NFS

1. Starting with a completely update to copy of PCLinuxOS, use synaptic to download the autofs package. This downloads the /etc/autofs/auto.master and associated files and setups up the autofs script in /etc/init.d/ and associated rc directories.

2. Using the PCLinuxOS Control Center -> Network & Internet -> Hosts Definition: Map the desired hostname to the IP address of the NFS server.

3. Using the PCLinuxOS Control Center -> System -> Manage system services: Enable at boot and start the following processes in this order rpcbind, nfs-common, netfs (nfs-common won't start unless rpcbind is already started). Autofs will already be enabled at boot because of step 1 but you'll need to start it if you don't won't to reboot before testing.

4. Test that autofs is working by navigating to /net/hostname-of-nfs-server/. You should see the paths that are being exported by your NFS server. There is an entry in the auto.master file that automatically mounts all nfs servers in your hosts list to the /net directory

5. (Optional) Modify auto.master to mount any number of subdirectories from your nfs server according to this How To or
Code: [Select]
man auto.master

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10620
  • MLUs Forever!
Re: Automount NFS shares using autofs
« Reply #1 on: August 29, 2012, 04:57:44 AM »
Thank you  ;)
MLUs rule the roost!

Linux XPS 3.2.18-pclos2.pae.bfs  32 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline tilaloz

  • Jr. Member
  • **
  • Posts: 25
Re: Automount NFS shares using autofs
« Reply #2 on: August 29, 2012, 06:36:50 AM »
When I get a chance, Just18, I'll apply your feedback.