LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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, 11:26 PM   #1
pwabrahams
Member
 
Registered: Nov 2005
Location: Deerfield MA
Distribution: OpenSuSE, Kubuntu
Posts: 293

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, 07:47 PM   #2
blacky_5251
Member
 
Registered: Oct 2004
Location: Adelaide Hills, South Australia
Distribution: RHEL 5&6 CentOS 5, 6 & 7
Posts: 573

Rep: Reputation: 61
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-09-2009, 12:00 AM   #3
pwabrahams
Member
 
Registered: Nov 2005
Location: Deerfield MA
Distribution: OpenSuSE, Kubuntu
Posts: 293

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, 04:30 AM   #4
blacky_5251
Member
 
Registered: Oct 2004
Location: Adelaide Hills, South Australia
Distribution: RHEL 5&6 CentOS 5, 6 & 7
Posts: 573

Rep: Reputation: 61
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, 10:00 PM   #5
pwabrahams
Member
 
Registered: Nov 2005
Location: Deerfield MA
Distribution: OpenSuSE, Kubuntu
Posts: 293

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, 05:39 PM   #6
rehdwolfe
LQ Newbie
 
Registered: Jul 2009
Posts: 3

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 45 04-06-2020 06:31 AM
USB automount with 2.6.20 not happening navin_karnam Linux - General 2 08-28-2008 12:48 AM
CentOS 5.2 Automount isos in fstab \other methods that work?automount iso Frankly3D Linux - General 6 07-13-2008 01:34 PM
Can't automount CIFS as normal user SlowCoder Linux - General 4 05-14-2007 04:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:03 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration