You are not logged in.

#1 2012-09-16 06:46:15

kilmister
Member
Registered: 2012-01-28
Posts: 22

CIFS share in /etc/fstab doesn't automatically mount

Hi,

I am having problems with my fstab, and automatically mounting a cifs share. The line in my fstab looks like this:

    //host.de/myuserfolder    /home/me/mountpoint    cifs    auto,uid=1000,gid=1000,username=blah,password=bleh    0 0

The real password ends in a tilde (~) which I didn't escape with a backslash or anything. Should still be okay, right?

Now during boot, the device does not get mounted, but if I type "mount -a" after booting, it does. I take this as a sign that the fstab line is correct. But then I have no idea why it wouldn't boot it automatically during boot.

Does anyone have an idea what could be the problem, or point me in a direction where to start searching?
Thanks in advance,
Alex

Last edited by kilmister (2012-09-17 20:15:38)

Offline

#2 2012-09-16 08:52:46

Šaran
Member
From: Bosnia
Registered: 2011-09-03
Posts: 407

Re: CIFS share in /etc/fstab doesn't automatically mount

My guess would be fstab gets processed before network is up.

Offline

#3 2012-09-16 13:44:37

kilmister
Member
Registered: 2012-01-28
Posts: 22

Re: CIFS share in /etc/fstab doesn't automatically mount

Šaran wrote:

My guess would be fstab gets processed before network is up.

This sounds plausible.. thanks.
Do you know how to check / fix this? is the "mount -a" somewhere in this init procedure thing?

Offline

#4 2012-09-16 13:55:15

Šaran
Member
From: Bosnia
Registered: 2011-09-03
Posts: 407

Re: CIFS share in /etc/fstab doesn't automatically mount

I don't know how to check, but you could make systemd unit which will run mount command after network has started.
This might be really dirty approach, but it's the only thing that comes to my mind right now.

Check this out for making unit files.

Offline

#5 2012-09-16 14:11:49

kilmister
Member
Registered: 2012-01-28
Posts: 22

Re: CIFS share in /etc/fstab doesn't automatically mount

Šaran wrote:

I don't know how to check, but you could make systemd unit which will run mount command after network has started.
This might be really dirty approach, but it's the only thing that comes to my mind right now.

Check this out for making unit files.

Thanks. Then I could also just put "mount -a" in my ~/.bashrc I guess. But I like the beautiful solutions... the quick'n'dirty stuff alarms my OCD-ness... smile

Offline

#6 2012-09-16 15:12:57

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,097
Website

Re: CIFS share in /etc/fstab doesn't automatically mount

mark it with _netdev in the mount options and use netfs in DAEMONS.

Offline

#7 2012-09-16 18:40:37

kilmister
Member
Registered: 2012-01-28
Posts: 22

Re: CIFS share in /etc/fstab doesn't automatically mount

falconindy wrote:

mark it with _netdev in the mount options and use netfs in DAEMONS.

It works! Thanks a ton.
I had to put "network" at the very first position in the DAEMONS array and "netfs" at the end. But now all is well.

Offline

#8 2012-09-17 20:20:50

kilmister
Member
Registered: 2012-01-28
Posts: 22

Re: CIFS share in /etc/fstab doesn't automatically mount

I have to bring this formerly [SOLVED] thread back to life.

I rebooted as I reported in my previous post and my share  was mounted successfully. However, the following two reboots, it did not get mounted.

I always hate those non-deterministic things that happen apparently "randomly" and not due to some messing around by me. It worked for one reboot, but not for the next one.

Any idea how to tackle this problem? I am rather inexperienced at this, two diagnostics that came into my mind are here:

[alexx@scholl ~]$ dmesg|grep -i mount
[    0.010196] Mount-cache hash table entries: 256
[    2.622933] EXT4-fs (sda1): mounting ext3 file system using the ext4 subsystem
[    2.631977] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[    6.857951] EXT4-fs (sda1): re-mounted. Opts: data=ordered
[    6.998701] EXT4-fs (sda3): mounting ext3 file system using the ext4 subsystem
[    7.012306] EXT4-fs (sda3): mounted filesystem with ordered data mode. Opts: data=ordered

[alexx@scholl ~]$ dmesg|grep -i cifs
[16378.371196] FS-Cache: Netfs 'cifs' registered for caching
[16378.371448] Key type cifs.spnego registered
[16378.371471] Key type cifs.idmap registered
[16378.371918] CIFS: no cache= option specified, using "cache=loose". This default will change to "cache=strict" in 3.7.
[16378.401692] CIFS VFS: default security mechanism requested.  The default security mechanism will be upgraded from ntlm to ntlmv2 in kernel release 3.3

The second command shows results from shortly ago, when I manually mounted the cifs share (with "mount -a", which still works).

Offline

#9 2012-09-17 21:14:56

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,097
Website

Re: CIFS share in /etc/fstab doesn't automatically mount

There's very little non-deterministic behavior in sysvinit unless you start trying to background things (like network) that really need to act as synchronization points in bootup. You need to post your /etc/rc.conf.

Offline

#10 2012-09-18 05:36:39

kilmister
Member
Registered: 2012-01-28
Posts: 22

Re: CIFS share in /etc/fstab doesn't automatically mount

falconindy wrote:

There's very little non-deterministic behavior in sysvinit unless you start trying to background things (like network) that really need to act as synchronization points in bootup. You need to post your /etc/rc.conf.

My /etc/rc.conf is really just this line:

DAEMONS=(network syslog-ng dbus crond cupsd netfs)

The /etc/fstab line in question is this one (I added _netdev now):

//hostname.de/username    /home/alexx/mammut    cifs    auto,_netdev,uid=1000,gid=1000,username=user,password=pass    0 0


Edit: What's also noteworthy, my external USB hard drive (seemingly) randomly doesn't get mounted at boot as well. It's fstab entry:
/dev/sdb1        /media/HDDRIVE2GO    vfat    auto,uid=1000,gid=1000    0 0

I'm not sure if this is the same problem or two different ones, though.

Last edited by kilmister (2012-09-18 12:13:47)

Offline

Board footer

Powered by FluxBB