Wednesday, October 22, 2014

setting up autofs



1. Create a dir to be shared
# mkdir /homedirs

2. Add entry to /etc/exportfs
# vi /etc/exports
/homedir *(rw,sync)

wq!

3. restart nfs service
# service autofs restart stop/start

# verify the share
# exportfs


go to client and test if nfs works

# mount 192.168.10.160:/homedirs /mnt

took long time to mount.

# showmount -e 192.168.10.12
clnt_create: RPC: Port mapper failure - Unable to receive: errno 113 (No route to


disable the firewall
# service iptables stop

Check what is shared for this host

# showmount -e 192.168.10.160
Export list for 192.168.10.160:
/homedirs *


try to moun again

# mount 192.168.10.160:/homedirs /mnt

it works

Note:  if some reason you have problem mounting, please stop nfs and rpcbind and restart rpcbind first and then start nfs.

Now, setup autofs on client
Add entry to /etc/auto.master to set up autofs
# vi /etc/auto.master
/ram    /etc/auto.rhome

# vi /etc/auto.rhome
*       -rw     192.168.10.160:/homedirs/&

No comments:

Post a Comment