Saturday, January 31, 2015

How to set up autofs


Plan:
a. First find your nfs share for your host.
# showmount -e nfs-server

b. Decide your mount mount point
/opt/nfs

============ Detail =================
1. Add enttry to /etc/auto.master file for your autofs

# cat /etc/auto.master
# /opt/nfs        /etc/auto.kuldeep

/opt /etc/auto.kuldeep

/opt/nfs  ==> // where are you going to mount - parent dir
/etc/auto.kuldeep ==>> define your child mount point and nfs share information

2. Define your nfs and nfs stuff
# cat /etc/auto.kuldeep
# archive         192.168.0.113:/opt/archive
nfs         192.168.0.113:/opt/archive

# check if its mounted
# df -h /opt/nfs/archive
df: `/opt/nfs/archive': No such file or directory

3. Restart autofs
# service autofs reload
Reloading maps

4. Verify the mount
#  df -hP /opt/nfs/archive
Filesystem                  Size  Used Avail Use% Mounted on
192.168.0.113:/opt/archive   18G   13G  3.7G  78% /opt/nfs/archive

No comments:

Post a Comment