Skip to contentSkip to conversation

More directories?

DISCUSSION Stef Bon 2 participants 6 messages Mar 9, 2008 – Mar 12, 2008 Kernel automounter

lore
Share & tools
lore

Stef Bon

author
#0 lore raw

Hello,

some time now I've been experimenting with mounting smb shares. Now the script
auto.smb which comes with the autofs package, generates given a server, all the shares.

../server/share/<mounted samba share>

Thus, it creates one level deep paths. I'm wondering, is it possible to create two or even more
level deep directories with a script simular to auto.smb??

I haven't been experimenting with it.

Stef Bon

maintainer
#1 lore raw
Quoted 7 lines · Stef Bon

Hello,

some time now I've been experimenting with mounting smb shares. Now the script
auto.smb which comes with the autofs package, generates given a server, all the shares.

Quoted 5 lines

../server/share/<mounted samba share>

Thus, it creates one level deep paths. I'm wondering, is it possible to create two or even more
level deep directories with a script simular to auto.smb??

Its totally dependent on what is returned from the script. The example script, auto.smb, just returns an entry with a multi-mount offset for each share. If a more complex multi-mount is returned that should work fine. The old auto.hosts would often return a more complex multi-mount entry as NFS exports are often deeper than a single level.

Ian

author
#2 lore raw
Quoted 9 lines · Ian Kent

Its totally dependent on what is returned from the script. The example script, auto.smb, just returns an entry with a multi-mount offset for each share. If a more complex multi-mount is returned that should work fine. The old auto.hosts would often return a more complex multi-mount entry as NFS exports are often deeper than a single level.

Ian

Ok, That's clear. I know that's it's the script which should return it.

What I want to know is, is it possible to use mountpoint's like:

../<USER>/server/share/<mounted smb share>

A multimount with the first key the <USER>.

Stef Bon

maintainer
#3 lore raw
Quoted 10 lines · Stef Bon
Quoted 9 lines · Ian Kent

Its totally dependent on what is returned from the script. The example script, auto.smb, just returns an entry with a multi-mount offset for each share. If a more complex multi-mount is returned that should work fine. The old auto.hosts would often return a more complex multi-mount entry as NFS exports are often deeper than a single level.

Ian

Quoted 7 lines

Ok, That's clear. I know that's it's the script which should return it.

What I want to know is, is it possible to use mountpoint's like:

../<USER>/server/share/<mounted smb share>

A multimount with the first key the <USER>.

Return everything else but the key as usual.
Format like:

[-fstype=<type>,<options] [[/] [localtion] \
	/<dir> location \
	/<dir> location ....

The leading "/" is required and the root mount "/" is optional. It's been a while since I played with this but I think the offsets of the multi-mount need to be in depth order.

Ian

author
#4 lore raw
Quoted 9 lines · Ian Kent

Return everything else but the key as usual.
Format like:

[-fstype=<type>,<options] [[/] [localtion] \
	/<dir> location \
	/<dir> location ....
Quoted 7 lines

The leading "/" is required and the root mount "/" is optional. It's been a while since I played with this but I think the offsets of the multi-mount need to be in depth order.

Ian

Ok, this format you give returns a list. This list is interpreted by the automount daemon,
and it determines which entry applies.

Now it should be possible to let this script (it has to be a script) only show the entry which applies:

-fstype=cifs,credentials=/home/sbon/.smb/mount.cred     / \
                         /sbon/lfs20060812/public ://lfs20060812/public

if I give the command:

ls <autofsmountpoint>/sbon/lfs20060812/public

This way the script is more "smart".

Stef Bon

maintainer
#5 lore raw
Quoted 17 lines · Stef Bon
Quoted 9 lines · Ian Kent

Return everything else but the key as usual.
Format like:

[-fstype=<type>,<options] [[/] [localtion] \
	/<dir> location \
	/<dir> location ....
Quoted 7 lines

The leading "/" is required and the root mount "/" is optional. It's been a while since I played with this but I think the offsets of the multi-mount need to be in depth order.

Ian

Quoted 6 lines

Ok, this format you give returns a list. This list is interpreted by the automount daemon,
and it determines which entry applies.

Now it should be possible to let this script (it has to be a script) only show the entry which applies:

No, that's not what I said.
This is a multi-mount entry, so by definition, all mounts in the hierarchy must be supplied when the entry is requested.

Quoted 3 lines
-fstype=cifs,credentials=/home/sbon/.smb/mount.cred     / \
                         /sbon/lfs20060812/public ://lfs20060812/public

No, that's not right.

The spec I gave said that if "/", the root of the mount tree is present, it must have a corresponding location, which isn't present here. Leave it out.

If you return this entry, without the "/", then it will be the only mount you will be able to make until it expires away. Until that time you will not be have an opportunity to supply another entry. If you don't need more mount offsets then this should work OK (without the "/").

This is the way it must be with multiple, possibly nested, mount entries.

Ian