LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 01-19-2009, 02:40 PM   #1
lheldwein
LQ Newbie
 
Registered: Jan 2009
Distribution: Fedora 2.6.25-14.fc9.i686
Posts: 10

Rep: Reputation: 0
Unhappy 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!!!

Laura
 
Old 01-19-2009, 03:18 PM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,499

Rep: Reputation: 193Reputation: 193
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.
 
Old 01-19-2009, 03:46 PM   #3
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Depending on your distro, rc.local may be found at /etc/rc.local or /etc/rc.d/rc.local

So please name your distro in your profile (see mine, at the left?) so we can give you clearer advice.

Put the command(s) you need to mount your filesystems in that file, just before the final exit 0 line. The comand(s) will be run as the root user.

Then try rebooting.
 
Old 01-20-2009, 09:42 AM   #4
lheldwein
LQ Newbie
 
Registered: Jan 2009
Distribution: Fedora 2.6.25-14.fc9.i686
Posts: 10

Original Poster
Rep: Reputation: 0
Talking Updated Profile

Thank you for the help. I updated my profile to include my distro. I hope I did it right???

I am trying your suggestions, I will let you know.

Thank you guys sooooo much.

Laura
 
Old 01-20-2009, 10:10 AM   #5
lheldwein
LQ Newbie
 
Registered: Jan 2009
Distribution: Fedora 2.6.25-14.fc9.i686
Posts: 10

Original Poster
Rep: Reputation: 0
Unhappy

Quote:
Originally Posted by tredegar View Post
Depending on your distro, rc.local may be found at /etc/rc.local or /etc/rc.d/rc.local

So please name your distro in your profile (see mine, at the left?) so we can give you clearer advice.

Put the command(s) you need to mount your filesystems in that file, just before the final exit 0 line. The comand(s) will be run as the root user.

Then try rebooting.
Ok I had added the mount line at the end of the rc.local script file it looks like this:

"touch /var/lock/subsys/local - (this line was already in the file)
mount -t nfs 192.168.1.5:/share /mnt/laura -o auto,users,_netdev"

Is there something wrong with my syntax????

Laura
 
Old 01-20-2009, 03:52 PM   #6
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Quote:
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.

Let us know how you get on.

Last edited by tredegar; 01-20-2009 at 03:54 PM.
 
Old 01-21-2009, 06:59 AM   #7
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,499

Rep: Reputation: 193Reputation: 193
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.
 
Old 01-21-2009, 09:07 AM   #8
lheldwein
LQ Newbie
 
Registered: Jan 2009
Distribution: Fedora 2.6.25-14.fc9.i686
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by kilgoretrout View Post
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.
 
Old 01-21-2009, 09:10 AM   #9
lheldwein
LQ Newbie
 
Registered: Jan 2009
Distribution: Fedora 2.6.25-14.fc9.i686
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by tredegar View Post
Yes, except I am not familiar with fedora.

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:-)

Thanks again!!!!
 
Old 01-21-2009, 09:13 AM   #10
lheldwein
LQ Newbie
 
Registered: Jan 2009
Distribution: Fedora 2.6.25-14.fc9.i686
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by kilgoretrout View Post
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.......

Thanks again, sorry for the ignorance.

Laura
 
Old 01-21-2009, 11:49 AM   #11
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Quote:
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.
 
Old 01-21-2009, 03:09 PM   #12
lheldwein
LQ Newbie
 
Registered: Jan 2009
Distribution: Fedora 2.6.25-14.fc9.i686
Posts: 10

Original Poster
Rep: Reputation: 0
Smile

Quote:
Originally Posted by tredegar View Post
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

Thank you very much.
 
Old 01-21-2009, 03:12 PM   #13
lheldwein
LQ Newbie
 
Registered: Jan 2009
Distribution: Fedora 2.6.25-14.fc9.i686
Posts: 10

Original Poster
Rep: Reputation: 0
Smile SOLUTION Found

I think I may have found a solution. I was bumming around in the Newbie forum and came across this:

My solution

Delay fstab mount of smbfs during boot

--------------------------------------------------------------------------------

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!!!

Thank you all for your help!!!

Laura
 
Old 01-22-2009, 04:36 PM   #14
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Quote:
THIS WORKED!!!
Well done!
Quote:
..it was posted by "C_Red"
Where was it posted? (Perhaps you should post the link, so others finding this thread can find their solution.)

Credit to yourself: you found an "elegant" solution without our help.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
NFS and RH Cluster Suite; Problems relating services/resources to NFS l_long_island Linux - Server 5 08-30-2008 11:20 AM
Problem with NFS mount during high load holst Linux - Server 4 09-16-2007 08:15 AM
Unable to mount NFS share through network IP hot_wired13 Linux - Server 1 09-02-2007 07:29 PM
Xandros mount point for Windows Network & NFS Network jaagut Linux - Distributions 1 09-14-2005 07:21 AM
Mount CDROM over network via NFS/SMB? smc_one Linux - Networking 2 08-19-2003 07:42 AM


All times are GMT -5. The time now is 10:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration