Page 1 of 1

[WORKAROUND] Shares not mounting at startup.

Posted: Sun Mar 03, 2013 1:53 pm
by spaceman
This is irritating, not least as all my other distro's are working correctly (except Sabayon :wink: ).

This is a line from my /etc/fstab/ file:

Code: Select all

//192.168.1.10/spaceman  /media/spaceman  cifs  credentials=/root/.smbcredentials,file_mode=0777,dir_mode=0777  0  0
Workaround for this problem is to open a terminal and issue:

Code: Select all

sudo mount -a
So you can conclude from this that cifs-utils are installed, the mount point(s) (/media/spaceman; /media/...) are created, the /root/.smbcredentials file exists and contains the correct username/password combination. So why won't LMDE MATE mount the shares like Linux Mint 14 'Nadia' MATE and Debian 6.0.6 Squeeze (et al, except Sabayon) are?

Thoughts?

Re: Shares not mounting at startup.

Posted: Sun Mar 03, 2013 2:25 pm
by altair4
I don't know why this is happening to you and I don't follow or use LMDE but I can offer a suggestion:

Create a script:

Code: Select all

gksu gedit /etc/network/if-up.d/fstab
With this content:

Code: Select all

#!/bin/sh
mount -a
Save the file, exit gedit, and back in the terminal make the file executable:

Code: Select all

sudo chmod +x /etc/network/if-up.d/fstab
You are basically giving in to the dark side and institutionalizing the "sudo mount -a" workaround at boot. Placing the script in if-up.d makes sure it's executed only after the network is up. This happened in Ubuntu and Ubuntu-based Mint for a couple of releases as it appeared that the instructions in fstab were being executed before the network was up and the samba related stuff failed.

Re: Shares not mounting at startup.

Posted: Mon Mar 04, 2013 9:47 am
by spaceman
Thanks altair4, that works a treat. It is a nasty workaround though, should I report this as a bug?

Nevertheless, this does work and is completely painless so thanks. I'm off to try to fix Sabayon with it now. If it works I'll link to this post from their forums where my question about this has had 114 views over the month it's been sitting there...unanswered. :lol:

Re: [WORKAROUND] Shares not mounting at startup.

Posted: Mon Mar 04, 2013 3:14 pm
by kwisher
I've seen this issue on other debian based distro's and never investigated it fully. I'm not sure if it has to do with kernel versions or what??

Re: [WORKAROUND] Shares not mounting at startup.

Posted: Thu Mar 07, 2013 5:44 pm
by abickerton
I ran into this after an nfs update some time ago, I switched to not always mounting the shares.
One question to ask yourself is, Do I really need to mount this stuff when I'm not logged in?
In my case the answer was no.

I have gdm mount the shares at login and logout. This approach would also work in classroom environment if that's what you want to do :-)

In fstab, define the shares you want users to be able to mount & unmount.

Code: Select all

192.168.150.2:/c/randomcrap/	/home/xxx/Downloads/keep	nfs	rw,user,noauto	0	0
Add the mount command to /etc/gdm3/PreSession/Default to add the share at login.

Code: Select all

mount /home/$USER/audio
Add the unmount to /etc/gdm3/PostSession/Default to remove the share on logout.

Code: Select all

umount /home/$USER/audio

Re: [WORKAROUND] Shares not mounting at startup.

Posted: Fri Mar 08, 2013 12:29 am
by kwisher
abickerton, excellent suggestion. I will have to give this a try sometime.

Re: [WORKAROUND] Shares not mounting at startup.

Posted: Mon Oct 06, 2014 7:07 am
by Gannet
Hi - this post worked for me - http://forums.linuxmint.com/viewtopic.php?f=42&t=144997. At the moment my passwords are in the /etc/auto.sambashares file. I'll do the rest of the hack when I get a "round tuit".