Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
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.
I have a CentOS 5.3 server. I cannot get my cifs share to mount on boot. After the machine is up I can issue a mount /mnt/sql just fine. I tried putting that in rc.local and it still didnt work.
What is the deal? why wont it mount on boot? What does this error mean? My guess is maybe samba is trying to start before the network is up. How can i change the order?
My guess is maybe samba is trying to start before the network is up. How can i change the order?
Your guess is correct:
Code:
[user@machine:~]:./errcvt 113
Error 113 is No route to host
The first thing you want to do is to add the "noauto" option to the line in "/etc/fstab". That will prevent the boot time errors from occurring.
The easy way to get it to mount at boot is to add "mount /mnt/sql" to "/etc/rc.local".
The harder way to get it to mount at boot is to write your own custom init script that runs after networking. The proper way to write an init script varies from distro to distro. You can usually find enough examples in your "/etc/init.d" directory to figure out how to write your own.
[rsmtech@massmail ~]$ cat /etc/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
mount /mnt/sql
Firstly, don't have the password in /etc/fstab. Use cred= option instead and have it point to a credentials file that only the user can read. Anyone can read /etc/fstab, so the password isn't secret. What version of mount.cifs do you have? I use the _netdev option in /etc/fstab without getting an error.
I'm also not sure if a windows share would be the best for a database server to run on if that is what this share is for, rather than a share of where sql queries are stored. NFS would probably work better.
[rsmtech@massmail ~]$ cat mount.log
mount error 113 = No route to host
You are still trying to mount the share before the network connection is completely functional.
Is your network connection through a wireless interface? If so, you have to wait for the authentication to complete. Frequently with wireless connections, the computer can fully believe the "network" is up and running before the "connection" is completely up and running.
You might want to put something like this before the mount command:
Code:
while ! ping -c 1 10.0.0.7 ;
do
sleep 1 ;
done
/bin/mount /mnt/sql
You might have to tweak the "ping" parameters to get the command right. I am writing this without testing it.
Quote:
Originally Posted by mitchell2345
How do i find what version of mount.cifs I have?
Good question. My "mount.cifs" command prints this as part of the usage:
Code:
To display the version number of the mount helper:
mount.cifs -V
However, running "mount.cifs -V" only causes the usage to be printed again.
AFAIK, the _netdev fstab option entry allows the bootup scripts to use -o no_netdev to mount non-network filesystems before the network is ready, or the -o _netdev option in a mount command to mount entries with the _netdev option.
Check the manpage for the mount command and see if the _netdev option exists. It has been around for quit a while. I don't understand why you wouldn't have it.
A boot up script should be able to use the _netdev or no_netdev options to mount. This would enable you to mount network filesystems without needing to explicitly list them in the script. e.g. mount -a -o _netdev
I am glad it worked. You may want to put a counter in there to make sure that the while loop does not run forever (e.g. you are booting your machine while not connected to the network). Here is some sample script code:
Code:
#!/bin/bash
COUNTER=0
while true ;
do
echo "COUNTER = ${COUNTER}"
((COUNTER++))
if (( COUNTER >= 10 )) ; then
echo "Counter limit reached. Exiting..."
exit 1 ;
fi
done
sometimes this will help, i believe the 1 at the end will tell fstab to retry the mount again later at the end of boot, possibly after your net starts.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.