Skip to contentSkip to conversation

No mount possible when only listing?

DISCUSSION Stef Bon 2 participants 3 messages Dec 25, 2007 – Dec 26, 2007 Kernel automounter

lore
Share & tools
lore

Stef Bon

author
#0 lore raw

Hello,

I'm using a construction to browse and to access the Windows/Samba network hosts and shares. It works like:

http://www.novell.com/coolsolutions/tip/19076.html

Now you access a share like:

ls -al /mydomain/hostA/firstsharehostA

it will mount the share (autofs does this) and the content of the share will be shown, as expected.

My construction, which you can find at:

http://www.howtoforge.com/automatic_discovery_mounting_smb_networkshares

works with shares which are symlinks pointing from a "networktree" in the homedirectory of the user to this autofs directory. In my case it looks like:

/home/sbon/Global Network/Windows Network/hostA/firstsharehostA -> /mydomain/hostA/firstsharehostA /home/sbon/Global Network/Windows Network/hostA/secondsharehostA -> /mydomain/hostA/secondsharehostA /home/sbon/Global Network/Windows Network/hostA/thirdsharehostA -> /mydomain/hostA/thirdsharehostA

In my howto on howtoforge I've used a different setup, but basically it's exactly the same.

Now when listing the content of the directory

ls -al /home/sbon/Global Network/Windows Network/hostA/firstsharehostA

it will act the same as shown above: the share will be mounted, and a virtual directory for the host is created by the automounter using autofs.

Now when you want to see the contents of hostA with:

ls -al /home/sbon/Global Network/Windows Network/hostA

it will show all shares hostA has (first, second and thirdsharehostA), but at the same time it will mount the shares, which is not necessary at all. I only want the content of hostA, not the content of the shares.

I can explain the behaviour. The ls command follows the symlink. When looking to where it is pointing to, the automounter is activated, and does a mount.

It is somehow possible to instruct the automounter, that when it comes to a simple "readlink" it does not mount the shares, but shows some sort of preview.

I hope you understand the problem. I can imagine it is quite complicated when reading this.

Stef Bon
Voorburg
the Netherlands

maintainer
#1 lore raw
Quoted 17 lines · Stef Bon

Hello,

I'm using a construction to browse and to access the Windows/Samba network hosts and shares. It works like:

http://www.novell.com/coolsolutions/tip/19076.html

Now you access a share like:

ls -al /mydomain/hostA/firstsharehostA

it will mount the share (autofs does this) and the content of the share will be shown, as expected.

My construction, which you can find at:

http://www.howtoforge.com/automatic_discovery_mounting_smb_networkshares

Quoted 8 lines

works with shares which are symlinks pointing from a "networktree" in the homedirectory of the user to this autofs directory. In my case it looks like:

/home/sbon/Global Network/Windows Network/hostA/firstsharehostA -> /mydomain/hostA/firstsharehostA /home/sbon/Global Network/Windows Network/hostA/secondsharehostA -> /mydomain/hostA/secondsharehostA /home/sbon/Global Network/Windows Network/hostA/thirdsharehostA -> /mydomain/hostA/thirdsharehostA

In my howto on howtoforge I've used a different setup, but basically it's exactly the same.

The auto.mydomain.sub is not a legal map and I can't say that it will continue to work that way you expect it to.

Only one wildcard entry is allowed in a map.

Quoted 12 lines

Now when listing the content of the directory

ls -al /home/sbon/Global Network/Windows Network/hostA/firstsharehostA

it will act the same as shown above: the share will be mounted, and a virtual directory for the host is created by the automounter using autofs.

Now when you want to see the contents of hostA with:

ls -al /home/sbon/Global Network/Windows Network/hostA

Quoted 8 lines

it will show all shares hostA has (first, second and thirdsharehostA), but at the same time it will mount the shares, which is not necessary at all. I only want the content of hostA, not the content of the shares.

I can explain the behaviour. The ls command follows the symlink. When looking to where it is pointing to, the automounter is activated, and does a mount.

It is somehow possible to instruct the automounter, that when it comes to a simple "readlink" it does not mount the shares, but shows some sort of preview.

I'm not sure I understand what you're saying but I think you're referring to a directory that contains symlinks. The directory that contains the symlinks isn't an automount managed directory and so autofs has no knowledge of what happens their. If you use color "ls" it will stat the links that point to valid automount mounts, performing a path walk on each, causing it to be mounted. I don't think there's much that can be done about this within the submounted setup that you're using.

I think the only way to get around this would be to enhance the setup using something along the lines of the auto.smb example program map in the distribution and version 5 of autofs.

Ian

author
#2 lore raw
Quoted 8 lines · On Wednesday 26 December 2007 13:49:44 you wrote:
Quoted 7 lines · Stef Bon

works with shares which are symlinks pointing from a "networktree" in the homedirectory of the user to this autofs directory. In my case it looks like:

/home/sbon/Global Network/Windows Network/hostA/firstsharehostA -> /mydomain/hostA/firstsharehostA /home/sbon/Global Network/Windows Network/hostA/secondsharehostA -> /mydomain/hostA/secondsharehostA /home/sbon/Global Network/Windows Network/hostA/thirdsharehostA -> /mydomain/hostA/thirdsharehostA

Quoted 7 lines
Quoted 1 line

In my howto on howtoforge I've used a different setup, but basically it's exactly the same.

The auto.mydomain.sub is not a legal map and I can't say that it will continue to work that way you expect it to.

Only one wildcard entry is allowed in a map.

Well, that's not very good news. This makes that my construction is not supported by version 5 of autofs. I asume there is a reason for this. Can you explain?

Quoted 8 lines
Quoted 7 lines

which is not necessary at all. I only want the content of hostA, not the content of the shares.

I can explain the behaviour. The ls command follows the symlink. When looking to where it is pointing to, the automounter is activated, and does a mount.

It is somehow possible to instruct the automounter, that when it comes to a simple "readlink" it does not mount the shares, but shows some sort of preview.

Quoted 8 lines

I'm not sure I understand what you're saying but I think you're referring to a directory that contains symlinks. The directory that contains the symlinks isn't an automount managed directory and so autofs has no knowledge of what happens their. If you use color "ls" it will stat the links that point to valid automount mounts, performing a path walk on each, causing it to be mounted. I don't think there's much that can be done about this within the submounted setup that you're using.

Indeed the ls command is responsible for the following of the symlinks. On my system there is an alias for ls: ls ='ls --color=auto'
I've tried to do a ls by invoking the command with the whole path (/bin/ls) and the behaviour is what I want: no mounting.
I can undo the creating of the alias, but the problem will remain when using the tools in a graphical environment like KDE. The default filemanager does follow the symlinks
(and does probably a stat or something).

So the problem remains. But it is no showstopper: it would be very nice when solved, but no disaster if it isn't.

Quoted 3 lines

I think the only way to get around this would be to enhance the setup using something along the lines of the auto.smb example program map in the distribution and version 5 of autofs.

Now my construction does not use smbclient when mounting. Instead is makes use of a cache (which is build with nbtscan and smbclient).
But anyhow, I cannot see directly how the auto.smb program can do this. Can you explain your idea more a little bit?

Stef Bon