Auto-mounting NFS with autofs

There is a client-side service called autofs that acts as an auto-mount service for both local and remote filesystems. This works with a kernel module and the user space service; as you enter a directory, the mount is created automatically. The autofs package needs to be installed along with the nfs-utils package if NFS mounts are to be made. The auto-mounting feature can work with other remote filesystems, not just NFS. To install autofs, use the following command:

$ sudo yum install -y autofs

With this installed, the default behavior is to use the /net directory point for the network hosts. We can then access shares or exports on any host that we have access to, and enter a directory that matches the server name ...

Get Learning RHEL Networking now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.