[Samba] autofs and samba

Xen list at xenhideout.nl
Wed Oct 5 19:40:03 UTC 2016


David Bear via samba schreef op 04-10-2016 19:15:
> Was trying to use autofs on ubuntu and mounting a samba shared failed.
> 
> Then, i came across a note that 'unless you need to authenticate to 
> cifs'
> -- wish I could find the exact quote now. The point is autofs fails to
> mount a windows server share. I can mount the share using mount.cifs 
> but it
> fails with autofs. So I just thought I would check to see if anyone has
> pointers on using autofs on ubuntu 16 .

I have all the information you need. Particularly because it took me 
days to get it working, and because I have been talking, you could say, 
to the autofs developer ever since (on the kernel mailing list) (for 
it).

Let me know what you need to do.

The first thing to know is that the auto.smb script is not very useful.

The second thing to know is that autofs cannot actually enumerate the 
shares of a server in the default configuration (by using a regular map 
file).

The third thing to know is that when you are using a regular map file, 
you will need to map each share separately if you want the directories 
to be visible. If you use the supplied auto.smb then your shares /won't 
be visible until you cd into them/.

The regular auto.smb and its example needs a precreated directory for 
the server but will not create the submount points for the shares until 
you use them, ie. until you cd into them.

I am saying conflicting things.

- the auto.smb file does enumerate the shares but does not precreate 
mount-points for them (this created trouble on very large systems where 
many commands could create "mount storms" where all shares would be 
mounted all at once).
- a direct map where you directly mount the share onto the mount point 
you have provided can hence not enumerate, you need to specify the very 
mount you use.

What you end up with is something like this:

media   -fstype=cifs,uid=$UID,gid=$GID,credentials=/etc/creds/server 
"://server/media"
backup  -fstype=cifs,uid=$UID,gid=$GID,credentials=/etc/creds/server 
"://server/backup"
home    -fstype=cifs,uid=$UID,gid=$GID,credentials=/etc/creds/server 
"://server/home"

This map file (static map file) will use the credentials from 
/etc/creds/server and mount these 3 shares (for example) under the mount 
point you specify in auto.master.

/cifs automount.server browse

The browse option (in auto.master) will cause the mount point for the 
shares to be precreated.

Otherwise you would only see them if you cd into them.

Like hidden doors.

I hope this is enough information. Maybe I misunderstood your request 
but I think this is all the information you need to get it working.

Regards.




More information about the samba mailing list