[Samba] Autofs and Fedora 11
Stef Bon
stef at bononline.nl
Sat Sep 19 15:26:35 MDT 2009
Well maybe it's a good idea to look at some constructions I've made,
just to automate the proces of making use of the windows network,
using native cifs and the automounter.
I'm using the utility nbtscan (or ip and nmblookup) to detect all the
SMB hosts, and smblient to detect all the shares an user has access to.
The first construction creates complete multi mount maps dynamically
when a user logs in and the session for her/him starts. This map file
and mountpoint
are added to the auto.master file dynamically, and there is only one
automounter running. Just after the auto.master file is changed when a
session ends, but also when it ends, this automounter gets a reload
signal to make the changes visible.
This worked but, had some serious drawbacks. The automounter regulary
just stopped running after a reload signal, while the maps were not empty.
And this construction makes use of multimount maps, which are not
flexible when it comes to changes. When a SMB host/server is new to the
network,
and it's discovered by scripts, it's not easy to make this change
visisble to an already running automounter. Even a reload signal was not
sufficient. This is caused by the static multimount maps.
Look at: http://linux.bononline.nl/linux/autofsmanaged/index.php
A second construction make use of a fuse module I created. With the
first construction the automounted mountpoints are in the user
homedirectory,
now it at a central place /mnt/network-autofs. And there is a daemon
running for every user. This is neccesary to stay secure, but I'm not
sure yet there is another sollution.
The automounter works with a very basis setup, and is not intended to be
accessed directly by the userm but through an interface, and that's the
fuse module.
Look at: http://linux.bononline.nl/linux/fuse-workspace/index.php
I hope this might interest you. If so email me, I'm very interested in
any feedback.
But what do you mean by not being able putting smb shares in auto.misc??
Sure you can.
Stef Bon
Ian wrote:
> Thank you, Stef, I'm sure this will fix it. I will try it this
> weekend. I still won't be able to put SMB shares as entries in
> auto.misc, but I can live with that.
>
> Ian
>
> Stef Bon wrote:
>> Hello,
>>
>> mounting with cifs requires an extra option for the ip.
>>
>> Some time ago I've had the same problem with the auto.smb script in
>> the autofs package,
>> and proposed modifications, simply when using the filesystem cifs, do
>> a lookup with the utility
>> nmblookup like:
>>
>> ipaddress=$($NMBLOOKUP $key --debug-level=0 2>>/dev/null | grep
>> '<00>' | awk '{ print $1 }')
>>
>> add the found ip address to the options like:
>>
>> opts="-fstype=cifs,guest,ip=$ipaddress"
>>
>> If no ip is found you can exit with an errorcode or continue and
>> mount without ip, but will propably also exit with error, because
>> that does not work.
>>
>>
>> Attached the modified file. The patch never made it to the source...
>>
>>
>> Hope it's of any help.
>>
>> Stef Bon
>> the Netherlands
>>
>> ps the name of the attached file is auto.smb.orig, rename this to
>> auto.smb and replace the old one with this.
>>
>>
>>
>> Ian Shay wrote:
>>>
>>> > Think that smbclient is using other methods for netbios name
>>> resolving,
>>> > maybe you can try //matsa.full.dns.name or //ip.address
>>>
>>> Wow, this seems unfortunate that mount.cifs does not honour
>>> smb.conf. At any rate, I cannot use what you are suggesting because
>>> the IP addresses are DHCP-assigned and the Linksys router that does
>>> the DHCP does not do DNS; it supplies an external DNS server, which
>>> of course won't work.
>>>
>>> So, given that I don't want to go through the process of giving
>>> static IPs and editing fstab or auto.misc every time a new laptop is
>>> temporarily added to the network, is there a way to have mount.cifs
>>> use BCAST as a way of resolving names?
>>>
>>> Furthermore, this was NOT a problem on the older Linux box that I am
>>> trying to replace (it has redhat 7 and some older version of samba).
>>> What can I do to get at least the same level of functionality as the
>>> old one had?
>>>
>>> Ian
>>
>
More information about the samba
mailing list