Auto mount of windows shares doesn't work.

Bug #311350 reported by Tom
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
samba (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: samba

I'm using Ubuntu 8.10 via an upgrade from 8.04. In 7.10 and 8.04 my auto mounts of shares on my windows box specified in my /etc/fstab worked like they should after the wireless connection on my laptop was established. This no longer is the case under 8.10. If I run "sudo mount -a" the shares are mounted. The relevant lines in my fstab are:

//192.168.4.10/NetworkShare /media/windows_f cifs nodfs,auto,rw,users,nounix,credentials=/root/.creds,uid=ttwaro,gid=ttwaro 0 0
//192.168.4.10/NetworkShare2 /media/windows_o cifs nodfs,auto,rw,users,nounix,credentials=/root/.creds,uid=ttwaro,gid=ttwaro 0 0

I've tried with and without the "nounix" parameter and with and without the "users" parameter as well as with and without the "nodfs" parameter. Nothing different. The mounts work manually every time after the wireless connection, via NetworkManager, is established. They are just not automatically mounted anymore since 8.10. Since they mount manually, and that the mounts use to work automatically, I have to believe that my credentials are correct.

I have even tried the "_netdev" option but that gives an error message that it is an invalid option for CIFS.

I have recently added the intrepid-proposed repository and updated to kernel 2.6.27-11-generic but still no luck.

This is more of an inconvenience that a show stopper but still this should work. Please let me know if I am doing anything wrong in my setup.

Kyle Cheung (kylezoa)
Changed in samba:
status: New → Confirmed
Revision history for this message
Thierry Carrez (ttx) wrote :

This might be by design...

In Ubuntu 8.10 network connections are handled by the new network-manager. By default wireless connections are defined "by user" and the wireless connection only happens when the user logs in. However network mounts from fstab are run before the user logs in, when the wireless connection is not yet available...

If you want to use the (wireless) network before being logged in (for example to automount network shares) you might want to try to convert your wireless connection to a "system" connection in network-manager (then it should be more like how it worked in 8.04). Let us know if it solves it.

Changed in samba:
status: Confirmed → Incomplete
Revision history for this message
Steve Langasek (vorlon) wrote :

The script /etc/network/if-up.d/mountnfs is meant to mount both nfs and cifs mounts present in /etc/fstab when the network interface comes up. This works just fine for me in the case of NFS mounts; I haven't tested with cifs, but I don't see anything in that script that should fail. (Unless NM is secretly bypassing this code and reinventing the wheel by mounting only NFS mounts, in which case that would be an NM bug.)

Revision history for this message
Tomasz Olszewski (caster) wrote :

Tom,

try commenting out everything in /etc/network/interfaces except "lo" parts (I presume you don't use anything else in there and that all your network connections are configured through NetworkManager). This worked for me and now my samba share is automatically mounted as soon as my network connection gets up.

Revision history for this message
Tom (ttwaro) wrote :

Tomasz,

Thanks for the suggestion. It worked. My Windows shares become available immediately after my wireless connections start.

I had one extra line in my /etc/network/interfaces:

auto eth0

After commenting it a rebooting to test my shares became active again automatically. I don't pretend to understand what that one line did and why commenting / removing it would make a difference but after many months in now works like it did in 8.04. I'm now running 9.04.

Revision history for this message
Thierry Carrez (ttx) wrote :

Closing this bug as a configuration issue: you shouldn't have had the "auto eth0" line in /etc/network/interfaces if those are handled by NM.

Changed in samba (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.