{"id":76479,"date":"2024-12-23T02:22:23","date_gmt":"2024-12-23T02:22:23","guid":{"rendered":"http:\/\/bangla.sitestree.com\/?p=76479"},"modified":"2024-12-25T03:19:28","modified_gmt":"2024-12-25T03:19:28","slug":"autofs-linux-autofs","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=76479","title":{"rendered":"AutoFS (Linux AutoFS)"},"content":{"rendered":"\n<p>AutoFS and Mounting in Linux\/Redhat\/CentOS<\/p>\n\n\n\n<p>echo &#8220;AutoFS &#8211; Automatic FS system Mounting &#8211; Dec 26th, 2017 by Sayed&#8221;<\/p>\n\n\n\n<p>check if Autofs installed or not<br>yum list installed | grep autofs<\/p>\n\n\n\n<p>I just installed; hence it is there<br>you can install with yum -y install autofs<\/p>\n\n\n\n<p>yum -y install autofs<\/p>\n\n\n\n<p>then you can enable autofs<br>systemctl status autofs<br>systemctl start autofs<br>systemctl enable autofs<\/p>\n\n\n\n<p>enable &#8211; will start this service at reboot\/system start<\/p>\n\n\n\n<p>AutoFS in general does not use \/etc\/fstab<br>AutoFS uses \/etc\/mtab file<br>Also, AutoFS has some files under \/etc and starting with auto. You can also define which file will contain the mounting mapping. the file that will act like \/etc\/fstab for autofs<\/p>\n\n\n\n<p>AutoFS has direct mapping and indirect mapping<br>let&#8217;s see some files under \/etc for autofs<\/p>\n\n\n\n<p>ls \/etc\/auto*<\/p>\n\n\n\n<p>The files<\/p>\n\n\n\n<p>\/etc\/auto.direct \/etc\/autofs.conf \/etc\/autofs_ldap_auth.conf \/etc\/auto.master \/etc\/auto.misc \/etc\/auto.net \/etc\/auto.smb \/etc\/auto.master.d:<\/p>\n\n\n\n<p>I saw to use \/etc\/auto.master for configuring which file will do the mapping for direct mounting.<br>I saw to use \/etc\/auto.misc for configuring which file will do the mapping for indirect mounting for AutoFS.<\/p>\n\n\n\n<p>One more config file is under: \/etc\/sysconfig\/autofs<\/p>\n\n\n\n<p>cat \/etc\/sysconfig\/autofs<\/p>\n\n\n\n<p>the content<br>#<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Init system options<\/h1>\n\n\n\n<p>#<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">If the kernel supports using the autofs miscellanous device<\/h1>\n\n\n\n<h1 class=\"wp-block-heading\">and you wish to use it you must set this configuration option<\/h1>\n\n\n\n<h1 class=\"wp-block-heading\">to &#8220;yes&#8221; otherwise it will not be used.<\/h1>\n\n\n\n<p>#<br>USE_MISC_DEVICE=&#8221;yes&#8221;<br>#<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Use OPTIONS to add automount(8) command line options that<\/h1>\n\n\n\n<h1 class=\"wp-block-heading\">will be used when the daemon is started.<\/h1>\n\n\n\n<p>#<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">OPTIONS=&#8221;&#8221;<\/h1>\n\n\n\n<p>#<\/p>\n\n\n\n<p>For mounting NFS i.e. remote\/network file-systems\/folders &#8211; we can use the regular mounting i.e. \/etc\/fstab and mount command. However, that is kinda manual. We can mount NFS using AutoFS that will be automatic mount<\/p>\n\n\n\n<p>We use AutoFS for LDAP clients to auto mount Users&#8217; home directories. We just configure, then the mounting happens automatically. You remember that getent passwd user-name mounted the remote users&#8217; home directory into local system. we used \/etc\/auto.master to tell that auto.guests will have the mounting configurations. then on \/etc\/auto.guests file &#8211; we configured that users&#8217; home directories will be mounted on \/home\/guests. you can check our notes on LDAP client configuration<\/p>\n\n\n\n<p>cat \/etc\/auto.master<br>vim \/etc\/auto.master<\/p>\n\n\n\n<p>we added the following line on \/etc\/auto.master<br>\/etc\/auto.guests \/etc\/auto.direct<\/p>\n\n\n\n<p>it just tells that AutoFS will consult \/etc\/auto.guests file for direct mapping<\/p>\n\n\n\n<p>vim \/etc\/auto.guests<br>we added the following line on \/etc\/auto.guests<br>\/home\/guests 192.168.1.15:\/nfsrh<\/p>\n\n\n\n<p>it just tells remote \/nfsrh will be automatically mounted to \/home\/guests<br>you can try to restart autofs<\/p>\n\n\n\n<p>systemctl restart autofs<\/p>\n\n\n\n<p>Indirect Map<br>indirectly mounted points are only visible when accessed<br>automatically mounts shares under one common parent directory<br>each indirect map put only one entry in the mtab file<br>local and indirect maps cannot exist in the same parent directory<br>for indirect mapping &#8211; you use \/etc\/auto.misc file From: http:\/\/sitestree.com\/?p=12070<br>Categories:DevOps, RHCSA<br>Tags:<br>Post Data:2017-12-26 15:27:27<\/p>\n","protected":false},"excerpt":{"rendered":"<p>AutoFS and Mounting in Linux\/Redhat\/CentOS echo &#8220;AutoFS &#8211; Automatic FS system Mounting &#8211; Dec 26th, 2017 by Sayed&#8221; check if Autofs installed or notyum list installed | grep autofs I just installed; hence it is thereyou can install with yum -y install autofs yum -y install autofs then you can enable autofssystemctl status autofssystemctl start &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=76479\">Continue reading<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1,1231],"tags":[],"class_list":["post-76479","post","type-post","status-publish","format-standard","hentry","category-root","category-----linux-and-unix","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":14040,"url":"http:\/\/bangla.sitestree.com\/?p=14040","url_meta":{"origin":76479,"position":0},"title":"AutoFS and Mounting in Linux\/Redhat\/CentOS","author":"Sayed","date":"December 26, 2017","format":false,"excerpt":"AutoFS and Mounting in Linux\/Redhat\/CentOS echo \"AutoFS - Automatic FS system Mounting - Dec 26th, 2017 by Sayed\" check if Autofs installed or not yum list installed | grep autofs I just installed; hence it is there you can install with yum -y install autofs 944 yum -y install autofs\u2026","rel":"","context":"In &quot;\u09b2\u09bf\u09a8\u09be\u0995\u09cd\u09b8 \u098f\u09ac\u0982 \u0989\u09a8\u09bf\u0995\u09cd\u09b8 \u0964 Linux and Unix&quot;","block_context":{"text":"\u09b2\u09bf\u09a8\u09be\u0995\u09cd\u09b8 \u098f\u09ac\u0982 \u0989\u09a8\u09bf\u0995\u09cd\u09b8 \u0964 Linux and Unix","link":"http:\/\/bangla.sitestree.com\/?cat=1231"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":67598,"url":"http:\/\/bangla.sitestree.com\/?p=67598","url_meta":{"origin":76479,"position":1},"title":"AutoFS and Mounting in Linux\/Redhat\/CentOS #DevOps #RHCSA","author":"Author-Check- Article-or-Video","date":"July 25, 2021","format":false,"excerpt":"AutoFS and Mounting in Linux\/Redhat\/CentOS echo \"AutoFS - Automatic FS system Mounting - Dec 26th, 2017 by Sayed\" check if Autofs installed or not yum list installed | grep autofs I just installed; hence it is there you can install with yum -y install autofs 944 yum -y install autofs\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":14034,"url":"http:\/\/bangla.sitestree.com\/?p=14034","url_meta":{"origin":76479,"position":2},"title":"NTP related commands\/Linux","author":"Sayed","date":"December 24, 2017","format":false,"excerpt":"598 echo \"dec 24th, 2017\" 599 echo \"NTP Client\" 600 yum list ntp 601 yum list installed |grep ntp 602 To activate ntp 603 yum -y install ntp system-config-date 604 cat \/etc\/ntp.conf 605 grep ^server \/etc\/ntp.conf 606 systemctl restart ntpd 607 systemctl enable ntpd 608 systemctl start ntpd 609 ntpq\u2026","rel":"","context":"In &quot;\u09b2\u09bf\u09a8\u09be\u0995\u09cd\u09b8 \u098f\u09ac\u0982 \u0989\u09a8\u09bf\u0995\u09cd\u09b8 \u0964 Linux and Unix&quot;","block_context":{"text":"\u09b2\u09bf\u09a8\u09be\u0995\u09cd\u09b8 \u098f\u09ac\u0982 \u0989\u09a8\u09bf\u0995\u09cd\u09b8 \u0964 Linux and Unix","link":"http:\/\/bangla.sitestree.com\/?cat=1231"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":67596,"url":"http:\/\/bangla.sitestree.com\/?p=67596","url_meta":{"origin":76479,"position":3},"title":"NTP related commands\/Linux #DevOps #RHCSA","author":"Author-Check- Article-or-Video","date":"July 25, 2021","format":false,"excerpt":"598 echo \"dec 24th, 2017\" 599 echo \"NTP Client\" 600 yum list ntp 601 yum list installed |grep ntp 602 To activate ntp 603 yum -y install ntp system-config-date 604 cat \/etc\/ntp.conf 605 grep ^server \/etc\/ntp.conf 606 systemctl restart ntpd 607 systemctl enable ntpd 608 systemctl start ntpd 609 ntpq\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":14029,"url":"http:\/\/bangla.sitestree.com\/?p=14029","url_meta":{"origin":76479,"position":4},"title":"TCP Wrappers in Linux\/CentOS\/Redhat\/Fedora","author":"Sayed","date":"December 24, 2017","format":false,"excerpt":"TCP Wrappers in Linux\/CentOS\/Redhat\/Fedora yum info tcp_wrappers yum install tcp_wrappers-devel.x86_64 506 reboot 507 ifdown ens33 508 ifup ens33 509 yum install tcp_wrappers-devel.x86_64 510 yum -y install tcp_wrappers-devel.x86_64 511 ls \/var\/ftp\/pub\/Packages\/ 512 ls \/etc\/yum.repos.d\/local.repo 513 vim \/etc\/yum.repos.d\/local.repo 514 systemctl status vsftpd 515 systemctl start vsftpd 516 systemctl enable vsftpd 517 yum\u2026","rel":"","context":"In &quot;\u09b2\u09bf\u09a8\u09be\u0995\u09cd\u09b8 \u098f\u09ac\u0982 \u0989\u09a8\u09bf\u0995\u09cd\u09b8 \u0964 Linux and Unix&quot;","block_context":{"text":"\u09b2\u09bf\u09a8\u09be\u0995\u09cd\u09b8 \u098f\u09ac\u0982 \u0989\u09a8\u09bf\u0995\u09cd\u09b8 \u0964 Linux and Unix","link":"http:\/\/bangla.sitestree.com\/?cat=1231"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":20401,"url":"http:\/\/bangla.sitestree.com\/?p=20401","url_meta":{"origin":76479,"position":5},"title":"Learn some Centos\/Redhat Linux: RHCE: MariaDB Administration on Redhat\/Fedora\/CentOS","author":"Author-Check- Article-or-Video","date":"February 20, 2021","format":false,"excerpt":"RHCE: MariaDB Administration on Redhat\/Fedora\/CentOS Check if mariaDB is installed or not 130 yum list installed | grep ^mariadb mariaDB originated from MySQL - after MySQL Got Bought by Oracle 133 yum list installed | grep ^mariadb I see - installed though not completely Output: mariadb-libs.x86_64 1:5.5.52-1.el7 @anaconda There are\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/76479","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=76479"}],"version-history":[{"count":1,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/76479\/revisions"}],"predecessor-version":[{"id":76480,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/76479\/revisions\/76480"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=76479"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=76479"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=76479"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}