cifs automount not happening -- and an incomplete workaround
Linux - NetworkingThis 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.
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.
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.
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.
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:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.