LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 05-07-2009, 10:26 PM   #1
pwabrahams
Member
 
Registered: Nov 2005
Location: Deerfield MA
Distribution: OpenSuSE, Kubuntu
Posts: 272

Rep: Reputation: 41
cifs automount not happening -- and an incomplete workaround


I have the same problem as a number of other people, running Kubuntu Jaunty as well as OpenSuSE 11.1: the CIFS entries in /etc/fstab don't get automounted. The cause, I know, is that it takes a while for the network connections to get established, and the mount command is issued during the startup ceremonies before the necessary connection exists. The same problem can occur for NFS mounts.

The solution, I believe, is to put something in /etc/rc.local like this:
Code:
(
while mounts are incomplete do
  mount -a
  sleep 10
done
)&
The problem I have is that I don't know how to test within the script whether the mounts are incomplete. The purpose of the & is to enable the startup sequence to continue even while waiting for the mounts, though for some people that might not be desirable.
 
Old 05-08-2009, 06:47 PM   #2
blacky_5251
Member
 
Registered: Oct 2004
Location: Adelaide Hills, South Australia
Distribution: RHEL 4&5, Fedora 10, CentOS 5.4, IPCop
Posts: 569

Rep: Reputation: 55
The solution in RHEL, CentOS and Fedora is to use the _netdev syntax in /etc/fstab, viz:-
Code:
//marvin/FaxReceived    /marvin/faxes           cifs    _netdev,credentials=/etc/samba/cred.txt 0 0
This tells the operating system that the mount is remote and may not be available, so the boot process doesn't wait for it to be mounted before continuing on.
 
Old 05-08-2009, 11:00 PM   #3
pwabrahams
Member
 
Registered: Nov 2005
Location: Deerfield MA
Distribution: OpenSuSE, Kubuntu
Posts: 272

Original Poster
Rep: Reputation: 41
_netdev and CIFS

Does _netdev work with CIFS? The man page doesn't list it as an option.
 
Old 05-09-2009, 03:30 AM   #4
blacky_5251
Member
 
Registered: Oct 2004
Location: Adelaide Hills, South Australia
Distribution: RHEL 4&5, Fedora 10, CentOS 5.4, IPCop
Posts: 569

Rep: Reputation: 55
Depends on which man page you look at I guess. "man mount" shows it, but "man mount.cifs" doesn't. It seems to work for me, so does it not work for you? Our Linux servers stay up so much longer than the Windows servers that it is rarely put to the test.
 
Old 05-10-2009, 09:00 PM   #5
pwabrahams
Member
 
Registered: Nov 2005
Location: Deerfield MA
Distribution: OpenSuSE, Kubuntu
Posts: 272

Original Poster
Rep: Reputation: 41
Results vary

Including _netdev on my OpenSUSE 11.1 system causes the CIFS mount to happen without intervention, but on my Kubuntu 9.04 Jaunty system, it doesn't. I wonder why. Here's the fstab entry for Kubuntu:
Code:
//hpmediavault/FileShare /mediavault cifs user,auto,rw,nodev,noexec,_netdev,guest 0 0
 
Old 07-31-2009, 04:39 PM   #6
rehdwolfe
LQ Newbie
 
Registered: Jul 2009
Posts: 1

Rep: Reputation: 0
Check SE Linux Settings

I had a problem with similar symptoms.

Mounting CIFS filesystem: error 13 opening credential file /etc/samba/cred.txt

my /etc/fstab entry was as follows:

//<ipaddress>/share /opt/server cifs credentials=/etc/samba/cred.txt 0 0



The resolution for me was related to SELINUX. My SELINUX was set to enforcing. I launched sealert -b and found that selinux was preventing access to /sbin/mount.cifs.

SELINUX prevented /sbin/mount.cifs from mounting on the file or directory "cred.txt".

It suggested that I could either relabel the directory or set the following boolean.

setsebool -P allow_mount_anyfile=1


What I did instead was to move my cred file to /etc/cred.txt (instead of /etc/samba/cred.txt) so it would pick up the context of /etc instead of /etc/samba.

This worked for me.
 
  


Reply

Tags
automount, cifs


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cifs "mount error 13 = Permission denied" CIFS SUCKS humbletech99 Linux - Networking 40 10-31-2012 08:50 AM
USB automount with 2.6.20 not happening navin_karnam Linux - General 2 08-27-2008 11:48 PM
CentOS 5.2 Automount isos in fstab \other methods that work?automount iso Frankly3D Linux - General 6 07-13-2008 12:34 PM
Can't automount CIFS as normal user SlowCoder Linux - General 4 05-14-2007 03:43 PM


All times are GMT -5. The time now is 04:18 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration