Fedora Linux Support Community & Resources Center
  #1  
Old 7th April 2008, 01:17 PM
scotty38 Offline
Registered User
 
Join Date: Mar 2008
Location: Nottingham, UK
Age: 20
Posts: 270
Mount a remote NFS drive at startup

Guys,

I'm very new with this stuff so please bare with me.....

I have an FC8 installation and I need to mount three drives. Two are local Windows NTFS drives (in the machine) and one is a remote NFS drive (QNAP NAS box).

I edited fstab for all three but only the local (NTFS) drives mount - I get an error for the NFS drive at startup. I've determined it's due to networking not being started at the time it tries to mount so I end up with a "network unreachable" type message.

I get the unmounted icon on my desktop which I can double click and all mounts ok.

However, for educational purposes I'm trying to automate it.

I have added the commands to rc.local but selinux pops up a message saying it can't do it but would if I modified the"mount any file" type parameter which I've done but it makes no difference.

I also added the command to the KDE autostart directory in my home drive but that also fails as it still tries to run before I get the desktop message telling me my network is connected.

Everything points to the machine trying to mount it before my ethernet interface is up so I understand why it's causing problems but I'm guessing I'm missing something.

Thanks in advance.....
Reply With Quote
  #2  
Old 8th April 2008, 07:37 AM
Jman Offline
Registered User
 
Join Date: Mar 2004
Location: Minnesota, USA
Age: 28
Posts: 7,909
Code:
chkconfig netfs on
Reply With Quote
  #3  
Old 8th April 2008, 10:41 AM
scotty38 Offline
Registered User
 
Join Date: Mar 2008
Location: Nottingham, UK
Age: 20
Posts: 270
Quote:
Originally Posted by Jman
Code:
chkconfig netfs on
Whilst I appreciate the time and effort you've taken to give me a response I'm not entirely sure what you're telling me - I am new to this I'm afraid.

I've googled an example netfs script and I'm guessing I still need to leave my nfs mount in /etc/fstab?

The script I found would also suggest that it exits if it determines networking is not up.

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

I'm not in front of my Fedora machine right now so does the netfs script already exist and does it address the points above or do I have to put up with an initial mount error and then how do I ensure this runs but only after networking has started?

Thanks......
Reply With Quote
  #4  
Old 9th April 2008, 11:12 AM
scotty38 Offline
Registered User
 
Join Date: Mar 2008
Location: Nottingham, UK
Age: 20
Posts: 270
Ok, I found the script on my machine and it's set to on for runlevels 2-5 but it doesn't appear to do anything.

Is there anything else I need to do to get this working?
Reply With Quote
  #5  
Old 10th April 2008, 08:37 AM
scotty38 Offline
Registered User
 
Join Date: Mar 2008
Location: Nottingham, UK
Age: 20
Posts: 270
Sorry to bump this guys. I'm doing my best to help myself here but I need a bit of assistance please...
Reply With Quote
  #6  
Old 10th April 2008, 08:45 AM
Hlingler Offline
Administrator
 
Join Date: Sep 2006
Location: Connellsville, PA, USA
Posts: 11,294
I don't understand the problem: if the remote share is available, and you have configured fstab correctly to mount it on startup, it should mount. Care to post your fstab so we can see?

V
Reply With Quote
  #7  
Old 10th April 2008, 09:18 AM
scotty38 Offline
Registered User
 
Join Date: Mar 2008
Location: Nottingham, UK
Age: 20
Posts: 270
Quote:
Originally Posted by Hlingler
I don't understand the problem: if the remote share is available, and you have configured fstab correctly to mount it on startup, it should mount. Care to post your fstab so we can see?

V
Thanks but that's my problem it tries to mount before networking is up so it can't actually reach the device.

I don't have the output to hand but the line in question will be along the lines:

x.x.x.x:qmultimedia /mnt/nas nfs default 0 0

The command works ok as I've set my desktop to display unmounted drives which it does. Click the icon and it mounts it fine, I'm just trying to get it done automatically.
Reply With Quote
  #8  
Old 10th April 2008, 09:29 AM
Hlingler Offline
Administrator
 
Join Date: Sep 2006
Location: Connellsville, PA, USA
Posts: 11,294
It should mount automatically with that entry. Something else must be wrong. Either the network connection is taking too long to come up, causing the mount to fail, or, the initscripts order has somehow become jumbled, causing the nfs to attempt to mount shares before the network initscript starts. I see no other possibilities, and I would lean towards guessing that some delay in the network connection is the root cause.

You can perhaps try a test of this: unmount the nfs shares, and bring down the network connection from the command line, then bring it up; see how long it takes to connect; that should give you some idea of the timing involved.

V
Reply With Quote
  #9  
Old 10th April 2008, 10:05 AM
scotty38 Offline
Registered User
 
Join Date: Mar 2008
Location: Nottingham, UK
Age: 20
Posts: 270
Yes, you could well be right although I'd not considered that networking was taking too long, I'd assumed it was going through the normal process. It definitely tries to mount before the network is up because I can see the messages at startup.

I only get a confirmation pop up of networking being connected once the desktop is up and running.

Where do I need to look or what do I need to do to have it start sooner.

I'll try what you suggested by the way once I'm in front of my machine tonight.
Reply With Quote
  #10  
Old 10th April 2008, 10:14 AM
Hlingler Offline
Administrator
 
Join Date: Sep 2006
Location: Connellsville, PA, USA
Posts: 11,294
Well, you could disable ipv6, but I'd have to search around because I can't remember offhand exactly how to do that. Try: 'Network Manager' from the menus, and for each "Device", edit the config to un-check IPV6. That should speed up network connections. Other adjustments may also be needed to optimize.

V
Reply With Quote
  #11  
Old 10th April 2008, 10:43 AM
scotty38 Offline
Registered User
 
Join Date: Mar 2008
Location: Nottingham, UK
Age: 20
Posts: 270
Yes, you could well be right although I'd not considered that networking was taking too long, I'd assumed it was going through the normal process. It definitely tries to mount before the network is up because I can see the messages at startup.

I only get a confirmation pop up of networking being connected once the desktop is up and running.

Where do I need to look or what do I need to do to have it start sooner.

I'll try what you suggested by the way once I'm in front of my machine tonight.
Reply With Quote
  #12  
Old 10th April 2008, 10:46 AM
Hlingler Offline
Administrator
 
Join Date: Sep 2006
Location: Connellsville, PA, USA
Posts: 11,294
Um...could you repeat that

V
Reply With Quote
  #13  
Old 10th April 2008, 10:50 AM
scotty38 Offline
Registered User
 
Join Date: Mar 2008
Location: Nottingham, UK
Age: 20
Posts: 270
Quote:
Originally Posted by Hlingler
Well, you could disable ipv6, but I'd have to search around because I can't remember offhand exactly how to do that. Try: 'Network Manager' from the menus, and for each "Device", edit the config to un-check IPV6. That should speed up network connections. Other adjustments may also be needed to optimize.

V
Not sure how I managed to post the same thing twice......

If memory serves me correctly I think IPv6 is already disabled but I will check as I've had a look around in there for inspiration already.

Even if I make anye modifications how do I get round the startup scripts trying to mount the drives before it starts networking - no matter how fast the network starts it is still coming after the mount attempt?

I may be wrong in this but when I watch the messages on screen I can see the failed mount and then a number of commands later I see some "networky" commands briefly just before the login gui fires up.
Reply With Quote
  #14  
Old 10th April 2008, 10:58 AM
Hlingler Offline
Administrator
 
Join Date: Sep 2006
Location: Connellsville, PA, USA
Posts: 11,294
Try:
rpm -V initscripts

This will tell you at least if anything major is out of whack with the initscripts. The individual scripts are numbered and belong to the individual packages that provide the services, and are started in logical order, so you might also check:
rpm -V `rpm -qa|grep -i network`
and:
rpm -V `rpm -qa|grep -i nfs`

Copy-and-paste those commands to get the funky "backtick" character.

Those commands will verify the integrity of the packages. You want to see: nothing. Any return will key you in to altered files, but you're looking for missing files, or altered config files.

V

EDIT: Here's an example of what you want to see:
Code:
[Vince@presario Thu Apr 10 05:37:04 ~]$ rpm -V initscripts
S.5....T c /etc/inittab  <<== I changed default runlevel to 5
S.5....T c /etc/rc.d/rc.local  << I added HDD spin-downs
..5....T c /etc/sysctl.conf  << I added port forwarding
[Vince@presario Thu Apr 10 06:04:45 ~]$
Anything other than what I know I changed is a "Bad Thing™©®"

EDIT#2: And here's an example of what you should investigate:
Code:
[Vince@presario Thu Apr 10 06:05:46 ~]$ rpm -V `rpm -qa|grep -i network`
S.5....T c /etc/lisarc
[Vince@presario Thu Apr 10 06:07:45 ~]$ rpm -V `rpm -qa|grep -i nfs`
S.5....T c /etc/sysconfig/nfs  <<==Hmm.  Suspicious: what did I play with?
S.5....T c /var/lib/nfs/etab  <<==Hmm.  Suspicious: what did I play with?
S.5....T c /var/lib/nfs/rmtab  <<==Hmm.  Suspicious: what did I play with?
missing     /var/lib/nfs/statd/sm (Permission denied) <<==Re-run check as root-user
..?..... c /var/lib/nfs/state  <<==Hmm.  Suspicious: what did I play with?
.......T c /var/lib/nfs/xtab  <<==Hmm.  Suspicious: what did I play with?
[Vince@presario Thu Apr 10 06:13:23 ~]$

Last edited by Hlingler; 10th April 2008 at 11:23 AM.
Reply With Quote
  #15  
Old 10th April 2008, 12:08 PM
scotty38 Offline
Registered User
 
Join Date: Mar 2008
Location: Nottingham, UK
Age: 20
Posts: 270
Brilliant, thanks very much, I'll work through this tonight.
Reply With Quote
Reply

Tags
drive, mount, nfs, remote, startup

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting my network drive to auto-mount on startup wizza Hardware & Laptops 10 29th October 2009 03:24 PM
SATA Drive. Mount on Startup. erich_18 Using Fedora 2 4th November 2008 09:22 AM
Start remote desktop at startup juniew Using Fedora 1 26th February 2008 01:29 AM
Unable to mount remote N/W Drive chidu_l Using Fedora 5 3rd October 2007 02:04 PM
How do I mount a remote CDROM drive? techmum Using Fedora 0 19th April 2006 01:18 AM


Current GMT-time: 07:24 (Tuesday, 16-09-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat