On our CentOS 4.4 box, I set up the nfs mount by putting the setting in fstab.
10.0.0.2:/export/files /files intr
After that I tested the setting by typing: mount /files
Everything worked as expected and files was mounted successfully. At this point I wanted to make sure server will do nfs mounts automatically at boot up. To my surprise once I rebooted the server, nfs mount did not happen. I checked the logs and found this:
May 11 11:00:24 www3 mount: mount: mount to NFS server '10.0.0.2' failed:
May 11 11:00:24 www3 mount: System Error: No route to host.
But once server booted up, I typed mount /files
and again, mount worked great. After poking around for a while I found out that when netfs script runs, netfs can not find network routes (due to network is still initializing). I tried few ways to get around this issue and settled on following solution:
vi /etc/init.d/netfs
insert: action $”Sleeping for 30 secs: ” sleep 30
right after: [ ! -f /var/lock/subsys/portmap ] && service portmap start
and right before: action $”Mounting NFS filesystems: ” mount -a -t nfs,nfs4
Basically we are going to give enough time for network to start and set up routes etc. You can play with that number after sleep command (we are basically pausing netfs script execution for 30 secs) and see what works for you. Once you are done, save/exit and reboot the server to see if number you used is sufficient sleep time. You can type df -h to see if it was mounted. If it wasn’t mounted, you can check /var/log/messages to see if nic was starting after nfs mount. If it is after, you will have to increase that number after sleep. Remember that you are only pausing the netfs script execution. Rest of the system continues to boot up. After I made changes, I checked my df output after reboot and my mount was there. I also checked /var/log/messages to see if everything looks ok there:
May 11 11:22:14 www3 kernel: bnx2: eth0 NIC Link is Up, 1000 Mbps full duplex
May 11 11:22:16 www3 netfs: Sleeping for 30 secs: succeeded
May 11 11:22:17 www3 netfs: Mounting NFS filesystems: succeeded
Thanks, it exactly fixed my issue. I don’t know why redhat website does not have solution on this.
Thank you very much for the solution. I google a lot because of this same problem happened to my server and now it’s fixed.
Thank you for this fix. I spent a few hours troubleshooting this problem before I found your blog! It works like a champ!
Thanks a lot
I just fixed my problem
thanks this fixed my problem in Caracas,
Much appreciated.
I am so happy that there are people like you who share their experience and knowledge.
One more thanks to you.
I am glad I can help. If you need any other help, please go ahead and post in my brand new forums ( http://crazytoon.com/forum/ ) and I will try to help as much as I can.
Pingback: CentOS5 (RHEL5) + 9TB Drive + AD + Win/OSX clients + BackupEXEC : Chatswood Computer Consultants Ltd.
http://kbase.redhat.com/faq/docs/DOC-3259
Try using the “_netdev” option in fstab:
ctfs1-p:/srv/eis /mnt/nfs nfs intr,_netdev 0 0
That works for me to make sure networking is up before the mount.
Nick
Great solution! I solved my problem.
Thank u so much
Steven Guan (Chinese name Shu Guan) is a cheater. He is working in Walt Disney as the programmer. He is from Shenyang China. His mainland Chinese wife Cathy Liu Xue Hong is a cheating partner. SHe is from Xian China.
They use their son and daughter to cheat other people sympathy. Shame of them!
Steve Guan (Chinese name Shu Guan) is a cheater. He is working in Walt Disney as the programmer. He is from Shenyang China. His mainland Chinese wife Cathy Liu Xue Hong is a cheating partner. SHe is from Xian China.
They use their son and daughter to cheat other people sympathy. Shame of them!
I intended to create you a little bit of note in order to say thank you once again for your beautiful techniques you have documented on this site. It has been simply pretty generous with you to convey unhampered exactly what a number of people would have marketed for an ebook in order to make some cash for their own end, certainly since you might well have done it if you ever considered necessary. Those ideas as well served to be a fantastic way to comprehend other individuals have the identical passion really like my very own to find out a lot more on the subject of this issue. I am certain there are a lot more pleasant instances ahead for people who looked at your site.