Unable to mount network shares through fstab

Bug #179654 reported by Jonathan Michaels
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
wicd
Fix Released
Undecided
Unassigned

Bug Description

I have several samba network shares loaded through smbfs in my fstab. A typical entry looks like this:
//nas/Pictures /home/user/Shared-Photos smbfs credentials=home/user/.credentials,rw,uid=user 0 0

The above works properly using network manager but fails to load with Wicd,

Possibly relevant info:
Wireless network is open.

Problem is repeatable: Reinstall NM, it works. Install Wicd, it fails.

Similiar report from another Wicd user was found at:
http://ubuntuforums.org/showthread.php?t=620777

Revision history for this message
Jonathan Michaels (jhmichaels) wrote :

For what it's worth, I CAN mount the share AFTER boot-up with the following command:

smbmount //nas/Pictures /home/user/Shared-Photos -o username=user,password=password

Revision history for this message
drdrewusaf (drdrewusaf) wrote :

Ok, after trying multiple ways in the rc.local script, I came up with a work around. First off, just putting "mount /whatever/mount/point" in rc.local does not work. Forcing rc.local to sleep did not work 100% (it was a crap shoot whether or not it would mount). So here it is:

1. Make sure rc.local is executable:

sudo chmod +x /etc/rc.local

2. There are two ways to do this part, you can put the script directly into rc.local or you can make a separate script and have rc.local run it. I chose the latter simply because I prefer my rc.local script to be clean, and I don't trust if/else statements in it. I named my script shrmnt, you can name it whatever you want.

sudo gedit /usr/bin/shrmnt

Copy and paste this script. This script, first, checks to see if the drive was already mounted (maybe a newer version of Wicd has a fix). If it is mounted it'll tell you with stars - if it's not mounted, then it sleeps to give the network time to settle before mounting.
#!/bin/bash
netDrive=/YOUR/DRIVE/MOUNT/POINT
varCheck=`mount | grep " $netDrive "`

if [[ ${#varCheck} > 0 ]]
then
   echo "*"
   echo "* The network drive $netDrive is already mounted! *"
   echo "*"
elif [[ ${#varCheck} == 0 ]]
then
   sleep 10
   mount $netDrive
fi

Save the file!

3. Next edit rc.local to run it.

sudo gedit /etc/rc.local

Put the command (fully qualified, just in case) above "exit 0". My rc.local looks like this (don't mind the modprobe...just tethering on sprint for free :-) ) :
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

/sbin/modprobe ipaq vendor=0x0bb4 product=0x00cf

/usr/bin/shrmnt

exit 0

There you have it, a perfectly good and probably too-complicated work around.

Attached is the script premade - just edit the mount point.

Drew

Revision history for this message
drdrewusaf (drdrewusaf) wrote :

Found out, on my wife's laptop, that the network connection comes up much slower than mine. Instead of adjusting the sleep time, I redid the entire script. I'm kind of new to writing complex scripts, so it didn't occur to me to use functions to get it to loop.

#!/bin/bash
netDrive=/media/share450
varCheck=`mount | grep " $netDrive "`

mnt () {
   mount $netDrive
   check
}
check () {
if [[ ${#varCheck} > 0 ]]
then
   echo "*"
   echo "* The network drive $netDrive is already mounted! *"
   echo "*"
elif [[ ${#varCheck} == 0 ]]
then
   sleep 10
   mnt
fi
}

check

Revision history for this message
drdrewusaf (drdrewusaf) wrote :

Didn't do a good check on that...now it will only run 10 times (instead of infinite loop).

Revision history for this message
Adam Blackburn (adamblackburn) wrote :

1.5.0 uses scripts run as root, so you should be able to have Wicd connect with that.

Changed in wicd:
status: New → Fix Committed
Dan O'Reilly (oreilldf)
Changed in wicd:
status: Fix Committed → Fix Released
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.