Configure AutoMount CentOS 7

Configure AutoMount CentOS 7

Configure AutoMount CentOS 7

If you use 389 or another type of LDAP, I would encourage you to use this article:

389-directory-serverldap-with-automount

Automount automatically mounts remote shares/directories to a specified folder. Let’s get started, login, and su to root

Root shell prompt on the CentOS 7 server

install the NFS utils, as this is what AutoMount most commonly is used for

yum -y install command to install the NFS and autofs packages

now install autofs

Running yum -y install autofs on CentOS 7 to install the AutoMount service

from here edit the /etc/auto.master file

Editing /etc/auto.master in vi to configure autofs on CentOS 7

in this case we are going to mount our FTP NFS shares automatically, configure the automaster map pointer

auto.master entry mapping /mnt/FTP to /etc/auto.ftp with --timeout=600 --ghost

from here now all we need to do is configure the auto.ftp map

vi /etc/auto.ftp command to create the autofs map

from here configure, and customize as follows:

auto.ftp map line: VirtualFolderName -fstype=nfs,rw servername:/nfs/mount

save+quit the file, now restart autofs, and set it to run on startup

Running service autofs restart on CentOS 7 to load the new AutoMount maps
chkconfig autofs on command to start autofs at boot

now if we browse to /mnt/FTP, we should see our 2 virtual folders, and inside of that will be our NFS mount

ls of /mnt/FTP showing the automounted Inbound and Outbound folders

Additional Considerations:

if you run into issues with LDAP/User mapping, try switching to NFSV3 as the default

Editing /etc/sysconfig/autofs in vi to configure AutoMount on CentOS 7

change lines 43/44 as follows:

/etc/sysconfig/autofs with MOUNT_NFS_DEFAULT_PROTOCOL set to 3

That’s it!

Hosted Linux Servers at www.zwiegnet.com/go

Leave a Reply

Your email address will not be published. Required fields are marked *