Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
05-07-2009, 11:26 PM
|
#1
|
Member
Registered: Nov 2005
Location: Deerfield MA
Distribution: OpenSuSE, Kubuntu
Posts: 293
Rep:
|
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.
|
|
|
05-08-2009, 07:47 PM
|
#2
|
Member
Registered: Oct 2004
Location: Adelaide Hills, South Australia
Distribution: RHEL 5&6 CentOS 5, 6 & 7
Posts: 573
Rep:
|
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.
|
|
|
05-09-2009, 12:00 AM
|
#3
|
Member
Registered: Nov 2005
Location: Deerfield MA
Distribution: OpenSuSE, Kubuntu
Posts: 293
Original Poster
Rep:
|
_netdev and CIFS
Does _netdev work with CIFS? The man page doesn't list it as an option.
|
|
|
05-09-2009, 04:30 AM
|
#4
|
Member
Registered: Oct 2004
Location: Adelaide Hills, South Australia
Distribution: RHEL 5&6 CentOS 5, 6 & 7
Posts: 573
Rep:
|
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.
|
|
|
05-10-2009, 10:00 PM
|
#5
|
Member
Registered: Nov 2005
Location: Deerfield MA
Distribution: OpenSuSE, Kubuntu
Posts: 293
Original Poster
Rep:
|
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
|
|
|
07-31-2009, 05:39 PM
|
#6
|
LQ Newbie
Registered: Jul 2009
Posts: 3
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 06:03 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|