network drives are not connected on start

Asked by Uwe E

I have 2 SMB shares on my debian server for which I have entries in my fstab (//ip-adress/share1 /home/uwe/mnt1 cifs credentials=/home/uwe/.creds,iocharset=utf8,codepage=cp850,uid=500,gid=100 0 0
//ip-adress/share2 /home/uwe/mnt2 cifs credentials=/home/uwe/.creds,iocharset=utf8,codepage=cp850,uid=500,gid=100 0 0).
So these shares should be mounted on boot-up. Sometimes it works, but sometimes it doesn't. There are no errors anywhere, on my windows PC there are no problems with this. Before I installed kubuntu I had a LFS system, there also were no problems. I am using Gutsy Gibbon on the client and debian stable on the server (Samba 3.0.24).
I tried to use names instead of ip-adresses but have the same symptoms, I moved the networking-script in /etc/rcS.d to S29networking, but still the same problems. Of course I could put a mount-script in the KDE-autostart folder but this would be sub-optimal.
Any Ideas?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Gilbert Mendoza (gmendoza) said :
#1

Can you issue the mount command manually to have it work?

i.e.
$ sudo mount /home/uwe/mnt2

If you say it sometimes works, and then doesn't... it doesn't make much sense. Also, using IP Addresses instead of the names will always provide better results, as DNS will be taken out of the equation. (Unless you enter the hostnames in /etc/hosts).

Setting it up in /etc/fstab should be fine, unless your network connection is not being initiated until after your desktop is activated. e.g. wireless connection using NetworkManager. You're mount may be failing due to no network connectivity in that example. Also, if your DHCP server is not giving you an IP in a timely manner, this could cause delays as well.

If you want to troubleshoot more, you can also run a network capture on your samba server to see if when your client is trying to connect to the server.

$ sudo tcpdump -ni eth0 host client_ip_address

This should be a good starting point.

Revision history for this message
Gilbert Mendoza (gmendoza) said :
#2

Also, just thinking out loud... if there is some type of network delay, you may want to make it s that your fstab does not mount the files on bootup.

Instead, you can use a script that is run immediately after your network interface is brought up. These scripts are run by NetworkManager, as well as manual network configurations and commands such as "ifup" and "ifdown". The scripts are located in the following directory:

/etc/network/if-up.d/

You can create a script of your own:

sudo gedit /etc/network/if-up.d/cifs

... and add something like the following:

#!/bin/sh
mount /home/uwe/mnt2 2>/dev/null &

Hehe.. one way to do it anyway. NFS has it's own script in that directory, and accomplishes the same principle.

Can you help with this problem?

Provide an answer of your own, or ask Uwe E for more information if necessary.

To post a message you must log in.