Setup autofs on RHEL

How to set up autofs – automount on RHEL

 

Install autofs package

yum install autofs

 

Enable, start and restart autofs daemon

systemctl enable autofs

systemctl start autofs

systemctl restart autofs

 

Configure settings of autofs

vi /etc/sysconfig/autofs

specify options to add timeout

OPTIONS=”–timeout”

 

vi /etc/auto.master

add the new auto.mount configuration file

write below /misc

/-      /etc/auto.mount

 

vi /etc/auto.mount

/nfs_mount -fstype=nfs,rw 192.168.0.50:/nfs_share

 

*Make sure to restart daemon when changing the configuration