{"id":79087,"date":"2026-11-17T01:59:42","date_gmt":"2026-11-17T01:59:42","guid":{"rendered":"http:\/\/bangla.sitestree.com\/?p=79087"},"modified":"2026-11-17T01:59:42","modified_gmt":"2026-11-17T01:59:42","slug":"linux-advanced-02-autofs","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=79087","title":{"rendered":"Linux Advanced 02 \u2014 NFS and On-Demand Mounting with AutoFS"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/bangla.sitestree.com\/?name=linux-course-index\">Linux course index<\/a> \u00b7 <a href=\"https:\/\/bangla.sitestree.com\/?cat=1992\">Linux Advanced category<\/a> \u00b7 Lesson 2 of 9<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>AI disclosure<\/strong> \u2014 AI-generated content, posted as is. AI can make mistakes. This lesson draws on the linked Open Education posts and adds original explanations or lab examples where useful. The newly written explanations and examples may be freely reused. Linked source material retains its own terms.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Learning goal<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Create an indirect AutoFS map and distinguish a running automounter from a successful NFS mount.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Concepts and setup<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">AutoFS mounts a filesystem on access and may expire an idle mount. The master map associates a base directory with a map file. An indirect map\u2019s key becomes a child of that base. The example adapts the site&#8217;s AutoFS and NFS mounting walkthrough.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You need a disposable client with autofs and NFS client tools and a second VM with an authorized read-only NFSv4 export at 192.168.56.20:\/labdocs. Substitute your real lab values, and put README.txt in the export. The client master map must include \/etc\/auto.master.d for the following layout to work.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Configure the map and trigger the mount<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># Use file names not already present in the lab.\nprintf '\/mnt\/oe-share \/etc\/auto.oe-share --timeout=60\\n' |\n  sudo tee \/etc\/auto.master.d\/oe-share.autofs\nprintf 'docs -fstype=nfs,ro,vers=4 192.168.56.20:\/labdocs\\n' |\n  sudo tee \/etc\/auto.oe-share\nsudo systemctl restart autofs\nsudo automount -m\ncat \/mnt\/oe-share\/docs\/README.txt\nfindmnt -T \/mnt\/oe-share\/docs -o SOURCE,TARGET,FSTYPE,OPTIONS<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Possible output<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>...\nMount point: \/mnt\/oe-share\n...\nHello from lab NFS\nSOURCE                 TARGET              FSTYPE OPTIONS\n192.168.56.20:\/labdocs  \/mnt\/oe-share\/docs  nfs4   ro,...<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Reading the file triggers a lookup. An autofs mount on the base is not proof that the remote export is mounted.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Inspect the journal and remove the lab map<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl -b -u autofs -n 20 --no-pager\ncd &quot;$HOME&quot;\nsudo rm \/etc\/auto.master.d\/oe-share.autofs \/etc\/auto.oe-share\nsudo systemctl restart autofs\nfindmnt -rn -t nfs,nfs4 -o TARGET<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Possible output<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>... autofs.service: Started ...\n# The lab mount under \/mnt\/oe-share is absent from the final list.<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Close programs that are holding files or directories open before cleanup. Do not remove pre-existing map files.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Questions only<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Quick-check questions<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li>What triggers the indirect mount?<\/li>\n\n\n<li>Why is systemctl status not sufficient to verify an export?<\/li>\n\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Assessment questions<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li>Decode the key, client path, and export in this map.<\/li>\n\n\n<li>If the map loads but cat times out, what should you inspect?<\/li>\n\n\n<li>How can you prove the export is mounted read-only without attempting to write?<\/li>\n\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Questions and answers<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Quick-check answers<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li><strong>What triggers the indirect mount?<\/strong><br><strong>Answer<\/strong> \u2014 An access to the key under the configured base directory.<\/li>\n\n\n<li><strong>Why is systemctl status not sufficient to verify an export?<\/strong><br><strong>Answer<\/strong> \u2014 The service can run with a broken map, inaccessible server, or invalid export.<\/li>\n\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Assessment answer key<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li><strong>Decode the key, client path, and export in this map.<\/strong><br><strong>Answer<\/strong> \u2014 The key is docs, its client path is \/mnt\/oe-share\/docs, and its export is 192.168.56.20:\/labdocs.<\/li>\n\n\n<li><strong>If the map loads but cat times out, what should you inspect?<\/strong><br><strong>Answer<\/strong> \u2014 Check the lab route, the server and NFS service, export authorization, path, and autofs journal.<\/li>\n\n\n<li><strong>How can you prove the export is mounted read-only without attempting to write?<\/strong><br><strong>Answer<\/strong> \u2014 Inspect the actual mount options with findmnt and confirm ro.<\/li>\n\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Source articles on this site<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n\n<li><a href=\"https:\/\/bangla.sitestree.com\/?p=67598\">AutoFS and Mounting in Linux\/Redhat\/CentOS #DevOps #RHCSA<\/a><\/li>\n\n\n<li><a href=\"https:\/\/bangla.sitestree.com\/?p=76479\">AutoFS (Linux AutoFS)<\/a><\/li>\n\n\n<li><a href=\"https:\/\/bangla.sitestree.com\/?p=14038\">On File Systems and Linux Commands (Redhat\/CentOs\/Fedora)<\/a><\/li>\n\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Continue the course<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Previous lesson 01 \u2014 LVM and Controlled Filesystem Growth. Next lesson 03 \u2014 SELinux Contexts, Booleans, and Denials.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/bangla.sitestree.com\/?name=linux-course-index\">Linux course index<\/a> \u00b7 <a href=\"https:\/\/bangla.sitestree.com\/?cat=1992\">Linux Advanced category<\/a> \u00b7 Lesson 2 of 9<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Create an indirect AutoFS map and distinguish a running automounter from a successful NFS mount.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1992],"tags":[],"class_list":["post-79087","post","type-post","status-publish","format-standard","hentry","category-linux-advanced","item-wrap"],"jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":14040,"url":"http:\/\/bangla.sitestree.com\/?p=14040","url_meta":{"origin":79087,"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":79087,"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":79102,"url":"http:\/\/bangla.sitestree.com\/?p=79102","url_meta":{"origin":79087,"position":2},"title":"Linux Administration Course \u2014 Start Here and Lesson Index","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"A 33-lesson Linux course from shell fundamentals to server administration, performance, and a recovery capstone.","rel":"","context":"In &quot;Linux Basics&quot;","block_context":{"text":"Linux Basics","link":"http:\/\/bangla.sitestree.com\/?cat=1990"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":79086,"url":"http:\/\/bangla.sitestree.com\/?p=79086","url_meta":{"origin":79087,"position":3},"title":"Linux Advanced 01 \u2014 LVM and Controlled Filesystem Growth","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"Create and expand an isolated LVM stack without touching the system disk.","rel":"","context":"In &quot;Linux Advanced&quot;","block_context":{"text":"Linux Advanced","link":"http:\/\/bangla.sitestree.com\/?cat=1992"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":79088,"url":"http:\/\/bangla.sitestree.com\/?p=79088","url_meta":{"origin":79087,"position":4},"title":"Linux Advanced 03 \u2014 SELinux Contexts, Booleans, and Denials","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"Diagnose ordinary permission and SELinux policy problems separately and set a persistent file context.","rel":"","context":"In &quot;Linux Advanced&quot;","block_context":{"text":"Linux Advanced","link":"http:\/\/bangla.sitestree.com\/?cat=1992"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":14038,"url":"http:\/\/bangla.sitestree.com\/?p=14038","url_meta":{"origin":79087,"position":5},"title":"On File Systems and Linux Commands (Redhat\/CentOs\/Fedora)","author":"Sayed","date":"December 26, 2017","format":false,"excerpt":"On File Systems and Linux Commands (Redhat\/CentOs\/Fedora) echo \"Dec 26th, 2017, Sayed Ahmed, Justetc Technologies\" On file Systems - Target Audience: Technical People. Software Developers and System\/Network Administrators or DevOps\u00a0 (or wanna be) \/ and \/boot are the default Linux file systems you can also configure \/home, \/opt, \/var, \/tmp,\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":[]}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/79087","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\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=79087"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/79087\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=79087"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=79087"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=79087"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}