Autofs: Difference between revisions

From Lolly's Wiki
Jump to navigationJump to search
(Die Seite wurde neu angelegt: „autofs autofs ==Automount home directories== ===/etc/auto.master=== <source lang=bash> # # Include /etc/auto.master.…“)
 
Line 23: Line 23:
So if you enter /home/a the automounter searches local for /data/home/a which will be mounted when found.
So if you enter /home/a the automounter searches local for /data/home/a which will be mounted when found.
<source lang=bash>
<source lang=bash>
# cd /home/a
# mount -v | grep /home/a
# mount -v | grep /home/a
/data/home/a on /home/a type none (rw,bind)
/data/home/a on /home/a type none (rw,bind)
Line 29: Line 30:
For another /home/b which is on the nfs server it looks like this:
For another /home/b which is on the nfs server it looks like this:
<source lang=bash>
<source lang=bash>
# cd /home/b
# mount -v | grep /home/b
# mount -v | grep /home/b
nfs.server.de:/home/b on /home/b type nfs (rw,addr=172.16.17.24)
nfs.server.de:/home/b on /home/b type nfs (rw,addr=172.16.17.24)
</source>
</source>

Revision as of 11:36, 16 December 2015

autofs autofs

Automount home directories

/etc/auto.master

#
# Include /etc/auto.master.d/*.autofs
#
+dir:/etc/auto.master.d

/etc/auto.master.d/home.autofs

/home   /etc/auto.master.d/home.map

/etc/auto.master.d/home.map

Mount homes from different locations.

*       :/data/home/& nfs.server.de:/home/&

The asterisk marks any dir in /home/* should be matched by this rule. The ampers and is replaced by the part which was matched by *. So if you enter /home/a the automounter searches local for /data/home/a which will be mounted when found.

# cd /home/a
# mount -v | grep /home/a
/data/home/a on /home/a type none (rw,bind)

For another /home/b which is on the nfs server it looks like this:

# cd /home/b
# mount -v | grep /home/b
nfs.server.de:/home/b on /home/b type nfs (rw,addr=172.16.17.24)