Please help NFS mount loading after the network services load
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
Please help NFS mount loading after the network services load
I have set up an NFS share over my ethernet network. It works great and I can manually mount from my two (2) client workstations. The server and workstations are running Fedora c9. I want to have the NFS share mount on boot and I can't seem to get it to work. When the client boots it hangs on the mount command and when it finally boots I issue the "mount" command and it didn't mount. If I run:
#service netfs restart
it reads the fstab file and mounts the NFS share. I think it might have something to do with the network not loading/starting until AFTER the "mount" command. I also noticed that in the network config GUI eth0 and eth1 shows "inactive" but the onboard ethernt network cards show eth4 and eth5 and "auto Ethernet" radio button is selected.
I have no clue, so if someone could help me that would be GREAT!!!
You can try editing /etc/rc.d/rc.local by adding your mount command for your NFS share to rc.local. The rc.local script is the last init script to run and if there is a timing issue with the mount command running before the network is fully up, that should correct the situation.
I updated my profile to include my distro. I hope I did it right???
Yes, except I am not familiar with fedora.
Quote:
Is there something wrong with my syntax????
It looks fine to me (but I haven't used nfs for years). I take it that that is the command you have used to mount the network directory successfully from the command line.
What happens when you reboot?
If the directory doesn't mount, maybe try adding what you posted in your first post: service netfs restart to rc.local
Slightly off-topic:
I remember I had a lot of trouble with nfs and eventually gave up on it: I now use konqueror's fish://[user@]server[:/path/to/directory] (eg fish://server opens my home on server) protocol which is more secure, and can use key-authenticated logins and encryption seamlessly.
I use fish as well but it's only for kde. It's a very nice implementation of sftp. I believe that gnome may have something similar but I'm not familiar with it. I mention that because fedora is gnomecentric and you are probablly running gnome.
Just a word of caution if you use fish or the gnome equivalent. The underlying protocol, sftp, is not really a networking filesystem protocol like nfs or samba; it's more like a secure form of ftp that uses ssh. It's very nice in that once you login to the remote machine you have access to the entire filesystem, i.e. you don't have the bother of setting up network shares. However, it is not designed for having multiple users simultaneously accessing and modifying the same remote filesystem like nfs or samba. It's great for home use where typically you just want to transfer files.
I use fish as well but it's only for kde. It's a very nice implementation of sftp. I believe that gnome may have something similar but I'm not familiar with it. I mention that because fedora is gnomecentric and you are probablly running gnome.
Just a word of caution if you use fish or the gnome equivalent. The underlying protocol, sftp, is not really a networking filesystem protocol like nfs or samba; it's more like a secure form of ftp that uses ssh. It's very nice in that once you login to the remote machine you have access to the entire filesystem, i.e. you don't have the bother of setting up network shares. However, it is not designed for having multiple users simultaneously accessing and modifying the same remote filesystem like nfs or samba. It's great for home use where typically you just want to transfer files.
Thank you so much, I do need to be able to have multiple users simultaneously access the remote file system. I don't understand why the mount won't work until the desktop is totally loaded and I run: #service netfs restart and then it runs. I tried the rc.local but it doesn't mount.
I did put the disk mounter on my task bar or added to my "panel" and its shows there unmounted so the user can just click on mount and it works, I just didn't want to have to do that step.
It looks fine to me (but I haven't used nfs for years). I take it that that is the command you have used to mount the network directory successfully from the command line.
What happens when you reboot?
If the directory doesn't mount, maybe try adding what you posted in your first post: service netfs restart to rc.local
Slightly off-topic:
I remember I had a lot of trouble with nfs and eventually gave up on it: I now use konqueror's fish://[user@]server[:/path/to/directory] (eg fish://server opens my home on server) protocol which is more secure, and can use key-authenticated logins and encryption seamlessly.
Let us know how you get on.
Thank you so much for taking the time to assist, I really appreciate it. Thank you for the information on the other topic but I am using Fedora which is gnome and as the other post said I do need to be able to have multiple users access the same share so I don't think that will work for me.
Thanks again maybe I will get this $#@ thing working:-)
You can try editing /etc/rc.d/rc.local by adding your mount command for your NFS share to rc.local. The rc.local script is the last init script to run and if there is a timing issue with the mount command running before the network is fully up, that should correct the situation.
I did and it still won't mount. When my system boots it hangs on the mount.nfs, which I assume when it reads the fstab file and it says it can't mount then it loads anacon and hangs again until I get an error about nfs mount a 2nd time. then I get the login screen and I logon open a terminal and run:
#service netfs restart
and it mounts perfectly. Is there anyway I can have the netfs service run after it loads the desktop??? Is that possible or am I just way off base, as usual.......
Is there anyway I can have the netfs service run after it loads the desktop?
Yes. This being linux there'll be several solutions, some more "elegant" and "robust" than others.
Meanwhile I am annoyed that our suggestions so far haven't helped you. But I like solving problems, so here goes:
Q1] Please list all your /etc/fstab preferably pasted within CODE tags (Click "Go Advanced" (at the bottom of the Quick Reply box), then you'll see that CODE tags are inserted by the # button in LQ's post-editor) so it is easier to read and check.
Quote:
I tried the rc.local but it doesn't mount.
Q2] What did you try in rc.local? What, if anything, happened? Please be exact: apparently inconsequential things (like not giving the /full/path/to/acommand ) can mean failure.
Q3] What do you currently have in rc.local (please list it, in CODE tags of course )
Quote:
I did put the disk mounter on my task bar or added to my "panel" and its shows there unmounted so the user can just click on mount and it works.
Well, that was one "workaround", but I'm sure we can do better.
Quote:
I just didn't want to have to do that step.
We understand, and with your help, will get it working the way you'd like it to.
Quote:
Thanks again, sorry for the ignorance.
No need to apologise, we are all learning something here. So, please answer the above Qs.
Yes. This being linux there'll be several solutions, some more "elegant" and "robust" than others.
Meanwhile I am annoyed that our suggestions so far haven't helped you. But I like solving problems, so here goes:
Q1] Please list all your /etc/fstab preferably pasted within CODE tags (Click "Go Advanced" (at the bottom of the Quick Reply box), then you'll see that CODE tags are inserted by the # button in LQ's post-editor) so it is easier to read and check.
Q2] What did you try in rc.local? What, if anything, happened? Please be exact: apparently inconsequential things (like not giving the /full/path/to/acommand ) can mean failure.
Q3] What do you currently have in rc.local (please list it, in CODE tags of course )
Well, that was one "workaround", but I'm sure we can do better.
We understand, and with your help, will get it working the way you'd like it to.
No need to apologise, we are all learning something here. So, please answer the above Qs.
Ok, thank you soooo much here is my fstab:
UUID=e0eda59e-bd69-4a6e-9fd1-47881a4c3af3 / ext3 defaults 1 1
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
192.168.1.5:/share /mnt/laura nfs users,exec 0 0
I copy and pasted it.
Here is my 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 -t nfs 192.168.1.5:/share /mnt/laura -o auto,users,_netdev
I think I've posted this elsewhere but I'll do it again here.
I used the Service Configuration GUI to stop netfs from starting at run levels 3 and 4 and then I went to /etc/rc5.d and moved S25netfs to S60netfs. I haven't had the time to see if a lower start sequence would work but this works for me and doesn't appear to hamper any other service. Anyone know why netfs needs to start so early?
it was posted by "C_Red"
THIS WORKED!!!!
When my desktop loads the nfs file system is MOUNTED!!!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.