mwatts
Mission Specialist
Mission Specialist
  • 1,265 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)
1 Solution

Accepted Solutions
Jeff_Henderson
Flight Engineer Flight Engineer
Flight Engineer
  • 669 Views

Re: Difference between Direct and Indirect Automount

Jump to solution

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

Reply
Loading...
3 Replies
Wasim_Raja
Moderator
Moderator
  • 1,095 Views

Re: Difference between Direct and Indirect Automount

Jump to solution
Reply
Loading...
Tracy_Baker
Starfighter Starfighter
Starfighter
  • 1,071 Views

Re: Difference between Direct and Indirect Automount

Jump to solution

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
Reply
Loading...
Jeff_Henderson
Flight Engineer Flight Engineer
Flight Engineer
  • 670 Views

Re: Difference between Direct and Indirect Automount

Jump to solution

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.

Reply
Loading...
Join the discussion
You must log in to join this conversation.