cancel
Showing results for 
Search instead for 
Did you mean: 
mwatts
Mission Specialist
Mission Specialist
  • 16.8K Views

Difference between Direct and Indirect Automount

Jump to solution

I've been trying to read up on this for the EX200 exam and haven't been able to make sense of it. Can someone explain the difference to me in an indirect/direct NFS mount?

Labels (3)
2 Solutions

Accepted Solutions
Tracy_Baker
Starfighter Starfighter
Starfighter
  • 15.5K Views

Here's a link to the video I use for my classes on this topic. This is for the RH134 class, chapter 9 (which my college calls CIS238RH).

autofs, with direct, indirect, and indirect "wildcard" (my term) mounts, begins at 37:48

[Please be kind... I had pneumonia when I recorded the video, so there times when I make some noises, like snuffling and coughing. Also, my videos are unedited; I leave my mistakes in them so students can see that (1) no one is perfect and (2) how to recover from a mistake.]

https://www.youtube.com/watch?v=gNYGQ5cqkm0

Program Lead at Arizona's first Red Hat Academy, est. 2005
Estrella Mountain Community College

View solution in original post

Jeff_Henderson
Flight Engineer Flight Engineer
Flight Engineer
  • 15.1K Views

The difference in their creation is only in how you identify the mount point in the master map file and the mapping file.

Direct Mount:

Master Map File is always /-

Mapping file contains the complete path to the mount point using absolute syntax.

Indirect Mount:

Master Map File: /<first portion of mount>

Mapping File contains the rest of the mount point or a wildcard using relative syntax

What happens when the autofs service starts or restarts is that it looks in the Master Map File (/etc/auto.master and all included files *.autofs) is that the autofs service creates the first portion of the mounts.  So in indirect mounts we see the portion from the Master Map File - but in the Direct mount my description is that it bounces off the /- and into the Mapping file and it creates all the directories defined for the mount point in the Mapping file.  

Direct Master Map:

/-     /etc/auto.direct

Direct Mapping File:

/demo        -rw,sync         serverx:/myshare1

/xfiles/shares  -rw,sync    serverx:/myshare2

So when autofs starts it will create the /demo, /xfiles, and /xfiles/shares directories

Indirect Master Map:

/indy    /etc/auto.indirect

Indirect Mapping File:

stuff      -rw,sync      serverx:/myshare3

items    -rw,sync      serverx:/myshare4

When autofs starts it only creates the /indy directory. Not /indy/stuff or /indy/items!

This changes the behavior in the following five ways:

1- Direct Mounts can have local files that were in the directory before the mount happened show up as well as the mounted shares, indirect mounts block access to local stored files as long as the mount is active.

2-Direct Mounts allow autocompletion (tab completion) for all directories, indirect only allows it for the created directory.

3-After autofs runs it creates an entry in the /etc/mtab (mount table) file for each mount autofs is watching. For the above example it would add two lines to the direct mount but only one line to the indirect mount.  Now consider that if you have hundreds of mount points using direct mounts would bloat this file (which is constantly being refreshed - try running tail -f /etc/mtab).  imagine the extra load on the system having hundred of more lines in this file - it can degrade performance.  Indirect mounts keep the /etc/mtab file leaner.

4-Indirect Mounts you can make changes to the Mapping file without having to restart autofs - as long as the mount is not currently active.

5-Indirect Mounts thus can use wildcards. If you had a wildcard with a direct mount it would have to produce an infinite number of directories when autofs bounces off /- and into the mapping file.

View solution in original post

15 Replies
Tracy_Baker
Starfighter Starfighter
Starfighter
  • 15.5K Views

Here's a link to the video I use for my classes on this topic. This is for the RH134 class, chapter 9 (which my college calls CIS238RH).

autofs, with direct, indirect, and indirect "wildcard" (my term) mounts, begins at 37:48

[Please be kind... I had pneumonia when I recorded the video, so there times when I make some noises, like snuffling and coughing. Also, my videos are unedited; I leave my mistakes in them so students can see that (1) no one is perfect and (2) how to recover from a mistake.]

https://www.youtube.com/watch?v=gNYGQ5cqkm0

Program Lead at Arizona's first Red Hat Academy, est. 2005
Estrella Mountain Community College
Chetan_Tiwary_
Community Manager
Community Manager
  • 6,774 Views

Thanks @Tracy_Baker for the video ! Video is just perfect for a learner !

0 Kudos
Jeff_Henderson
Flight Engineer Flight Engineer
Flight Engineer
  • 15.1K Views

The difference in their creation is only in how you identify the mount point in the master map file and the mapping file.

Direct Mount:

Master Map File is always /-

Mapping file contains the complete path to the mount point using absolute syntax.

Indirect Mount:

Master Map File: /<first portion of mount>

Mapping File contains the rest of the mount point or a wildcard using relative syntax

What happens when the autofs service starts or restarts is that it looks in the Master Map File (/etc/auto.master and all included files *.autofs) is that the autofs service creates the first portion of the mounts.  So in indirect mounts we see the portion from the Master Map File - but in the Direct mount my description is that it bounces off the /- and into the Mapping file and it creates all the directories defined for the mount point in the Mapping file.  

Direct Master Map:

/-     /etc/auto.direct

Direct Mapping File:

/demo        -rw,sync         serverx:/myshare1

/xfiles/shares  -rw,sync    serverx:/myshare2

So when autofs starts it will create the /demo, /xfiles, and /xfiles/shares directories

Indirect Master Map:

/indy    /etc/auto.indirect

Indirect Mapping File:

stuff      -rw,sync      serverx:/myshare3

items    -rw,sync      serverx:/myshare4

When autofs starts it only creates the /indy directory. Not /indy/stuff or /indy/items!

This changes the behavior in the following five ways:

1- Direct Mounts can have local files that were in the directory before the mount happened show up as well as the mounted shares, indirect mounts block access to local stored files as long as the mount is active.

2-Direct Mounts allow autocompletion (tab completion) for all directories, indirect only allows it for the created directory.

3-After autofs runs it creates an entry in the /etc/mtab (mount table) file for each mount autofs is watching. For the above example it would add two lines to the direct mount but only one line to the indirect mount.  Now consider that if you have hundreds of mount points using direct mounts would bloat this file (which is constantly being refreshed - try running tail -f /etc/mtab).  imagine the extra load on the system having hundred of more lines in this file - it can degrade performance.  Indirect mounts keep the /etc/mtab file leaner.

4-Indirect Mounts you can make changes to the Mapping file without having to restart autofs - as long as the mount is not currently active.

5-Indirect Mounts thus can use wildcards. If you had a wildcard with a direct mount it would have to produce an infinite number of directories when autofs bounces off /- and into the mapping file.

Chetan_Tiwary_
Community Manager
Community Manager
  • 6,772 Views

@Jeff_Henderson The summary is succint and concise !

0 Kudos
  • 7,022 Views

I realize this discussion is a year old now, but I wanted to thank Jeff Henderson for the very clear and sustinct explanaition. About to re-certify after a 6 years, and I suspect many of us never use this autofs in our day to day (At least I never have).

Wasim_Raja
Moderator
Moderator
  • 7,008 Views

Agree

0 Kudos
shashi01
Moderator
Moderator
  • 7,000 Views

@CommanderRiker 

I appreciate you recognizing Jeff Henderson's useful explanation even a year later. It's encouraging to know that his guidance remains relevant as you get ready for your certification renewal.

If autofs isn't frequently used in daily tasks, it's still beneficial to review these concepts for a wider understanding and skill enhancement.

0 Kudos
Chetan_Tiwary_
Community Manager
Community Manager
  • 6,966 Views

@CommanderRiker Thanks for your input here. In my previous job role as a system admin - we frequently used to encounter stale file error in NFS mounts. For example LDAP user home directories - we resolved the same using automount tool. It is used in many organisations - that I know and is a very helpful technology. 

0 Kudos
Join the discussion
You must log in to join this conversation.