50 likes | 56 Views
AutoFS is a utility that mounts local or remote drives only when they are accessed and if you donu2019t use them, they will be unmounted automatically after a certain time (as configured).
E N D
DevOpsCheetah Home Linux Cloud Programming Monitoring CI/CD Categories AUTOFS June 2, 2021 Atul Rajput 0 Comment AutoFS is a utility that mount local or remote drives only when they are accessed and if you don’t use them, they will be unmounted automatically after a certain time (as configured). Difference Between /etc/fstab and Autofs (AutoMount) As we know that /etc/fstab is used for permanent mounting of file systems but it has advantage only if you have limited mount points connected to your /etc/fstab file but if you are working on a large organisation and have so many mount points linked to your /etc/fstab file then in that case your overall system’s performance gets effected. But Autofs mounts the file systems on user’s demand. By default, the mount point configured in Autofs is in unmounted state till the user access the mount point, once user try to access the mount point it will mount automatically and if user "Cookie Settings" to provide a controlled consent. We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit Cookie Settings Accept All
don’t use the mount point for some time then it will automatically go to unmounted state. How to Configure AUTOFS in RHEL Machine Prerequisites You should have sudo permissions as a user autofs package should be installed on your machine Configuration Files used in Autofs /etc/auto.master /etc/auto.misc (name of this file can be anything) /etc/sysconfig/autofs Steps for configuring Autofs : In our example we will mount the NFS share using autofs. NFS share ‘/db_backup‘ is exported from NFS Server (192.168.1.21). We are going to mount this nfs share on CentOS 7 machine 1 : Edit the Master map file(/etc/auto.master) [root@devopscheetah ~]# cat /etc/auto.master | grep -v “#” /dbstuff /etc/auto.nfsdb –timeout=180
/dbstuff should be a directory on your client system. NFS Share will automatically umount after 180 seconds or 3 minutes if user doesn’t access the share. /etc/auto.nfsdb is our MAP File where we will configure the NFS server and Mount details. 2 : Configure map file ‘/etc/auto.nfsdb’ [root@devopscheetah ~]# cat /etc/auto.nfsdb db_backup -fstype=nfs,rw,soft,intr 192.168.1.21:/db_backup db_backup is a directory where ‘192.168.1.21:/db_backup’ is mounted. -fstype=nfs is the file system type & ‘rw,soft,intr’ are mount options. ‘192.168.1.21:/db_backup’ is nfs share location. 3 : Start the auotfs service [root@devopscheetah ~]# systemctl start autofs.service [root@devopscheetah ~]# systemctl enable autofs.service 4 : Now try to access the mount point Mount point of nfs share will be ‘/dbstuff/db_backup’. When we try access the mount point then autofs service will mount nfs share automatically and the content of db_backup directory will be accessible.
Check out : How we can create VPC/Subnets on AWS ? Tags: AutoFS , Autofs in RHEL Leave a Reply Your email address will not be published. Required fields are marked * Comment Name *
Email * Website Save my name, email, and website in this browser for the next time I comment. POST COMMENT Previous Post Next Post Related Posts Blogs About Us Contact Us Privacy Policy © 2021. DevOpsCheetah.com PDFmyURL.com - convert URLs, web pages or even full websites to PDF online. Easy API for developers!