Skip to contentSkip to conversation

autofs as a tfs replacement?

DISCUSSION Piete Brooks 2 participants 2 messages Apr 19, 2007 Kernel automounter

lore
Share & tools
lore
#0 lore raw

[ apologies if this is a repeat, but I didn't notice getting my copy before ]

Is there a simple way to get autofs to behave like tfs to get:

IF /localdir/$key/ exists
THEN use /localdir/$key/
ELSE use server:/remotedir/$key/

I was hoping to use something like the multi-home mechanism which tried each path in order until one worked.

I can set it up by hand using

	d1	:/localdir/&
	d2	:/localdir/&
	*	-rw server:/remotedir/&

but that needs editing on each host as each /localdir/ is created.

I assume I can HACK it using a programme hook which looks to see if /localdir/& exists, but it would be much cleaner to use the multi-home style list. Is this possible?

maintainer
#1 lore raw
Quoted 11 lines · Piete Brooks

[ apologies if this is a repeat, but I didn't notice getting my copy before ]

Is there a simple way to get autofs to behave like tfs to get:

IF /localdir/$key/ exists
THEN use /localdir/$key/
ELSE use server:/remotedir/$key/

I was hoping to use something like the multi-home mechanism which tried each path in order until one worked.

Quoted 7 lines

I can set it up by hand using

	d1	:/localdir/&
	d2	:/localdir/&
	*	-rw server:/remotedir/&

but that needs editing on each host as each /localdir/ is created.

Don't quite know what you mean by this?

Quoted 4 lines

I assume I can HACK it using a programme hook which looks to see if /localdir/& exists, but it would be much cleaner to use the multi-home style list. Is this possible?

Maybe:

* -rw :/localdir/& server:/remotedir/&

I think that if /localdir/& doesn't exist the bind mount will fail after which server:/remotedir/& should be tried.

Ian