cifs not mounting on boot
Hi,
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. some details: Code:
//10.0.0.7/share /mnt/sql cifs username=mail,password=xxxxxxxx 0 0 Code:
[root@massmail ~]# chkconfig --list netfs Code:
[root@massmail ~]# service netfs status Code:
[root@massmail ~]# ls /mnt/sql Code:
[root@massmail ~]# mount /mnt/sql Code:
[root@massmail ~]# dmesg |grep CIFS Thanks, Mitchell |
Quote:
Code:
[user@machine:~]:./errcvt 113 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. |
forgot to add this to the org. post.
i have tried the rc.local. Code:
[rsmtech@massmail ~]$ cat /etc/rc.local More suggestions? Thanks, Mitchell |
Quote:
Code:
mount /mnt/sql > /var/log/mntsql.log |
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. |
Quote:
|
Quote:
Mitchell |
Quote:
|
Quote:
mount error 113 = No route to host Refer to the mount.cifs(8) manual page (e.g.man mount.cifs) how do i find what version of mount.cifs I have? |
Quote:
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 ; Quote:
Code:
To display the version number of the mount helper: |
ill try adding the if statement. no its not on a wireless connection.
|
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 |
Quote:
Thanks! Mitchell |
Quote:
Code:
#!/bin/bash |
if you want this to work from your fstab, try changing the 0 0 at the end to 0 1, like such:
Code:
//10.0.0.7/share /mnt/sql cifs username=mail,password=xxxxxxxx 0 1 |
All times are GMT -5. The time now is 08:54 PM. |