 |
 |
 |
 |
| Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum. |

7th April 2008, 01:17 PM
|
 |
Registered User
|
|
Join Date: Mar 2008
Location: Nottingham, UK
Age: 18
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.....
|

8th April 2008, 07:37 AM
|
|
Registered User
|
|
Join Date: Mar 2004
Location: Minnesota, USA
Age: 27
Posts: 7,909

|
|
|
|

8th April 2008, 10:41 AM
|
 |
Registered User
|
|
Join Date: Mar 2008
Location: Nottingham, UK
Age: 18
Posts: 270

|
|
Quote:
|
Originally Posted by Jman
|
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......
|

9th April 2008, 11:12 AM
|
 |
Registered User
|
|
Join Date: Mar 2008
Location: Nottingham, UK
Age: 18
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?
|

10th April 2008, 08:37 AM
|
 |
Registered User
|
|
Join Date: Mar 2008
Location: Nottingham, UK
Age: 18
Posts: 270

|
|
|
Sorry to bump this guys. I'm doing my best to help myself here but I need a bit of assistance please...
|

10th April 2008, 08:45 AM
|
 |
Administrator
|
|
Join Date: Sep 2006
Location: Connellsville, PA, USA
Posts: 11,289

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

10th April 2008, 09:18 AM
|
 |
Registered User
|
|
Join Date: Mar 2008
Location: Nottingham, UK
Age: 18
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.
|

10th April 2008, 09:29 AM
|
 |
Administrator
|
|
Join Date: Sep 2006
Location: Connellsville, PA, USA
Posts: 11,289

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

10th April 2008, 10:05 AM
|
 |
Registered User
|
|
Join Date: Mar 2008
Location: Nottingham, UK
Age: 18
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.
|

10th April 2008, 10:14 AM
|
 |
Administrator
|
|
Join Date: Sep 2006
Location: Connellsville, PA, USA
Posts: 11,289

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

10th April 2008, 10:43 AM
|
 |
Registered User
|
|
Join Date: Mar 2008
Location: Nottingham, UK
Age: 18
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.
|

10th April 2008, 10:46 AM
|
 |
Administrator
|
|
Join Date: Sep 2006
Location: Connellsville, PA, USA
Posts: 11,289

|
|
Um...could you repeat that
V
|

10th April 2008, 10:50 AM
|
 |
Registered User
|
|
Join Date: Mar 2008
Location: Nottingham, UK
Age: 18
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.
|

10th April 2008, 10:58 AM
|
 |
Administrator
|
|
Join Date: Sep 2006
Location: Connellsville, PA, USA
Posts: 11,289

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

10th April 2008, 12:08 PM
|
 |
Registered User
|
|
Join Date: Mar 2008
Location: Nottingham, UK
Age: 18
Posts: 270

|
|
|
Brilliant, thanks very much, I'll work through this tonight.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 09:01 (Wednesday, 22-05-2013)
|
|
 |
 |
 |
 |
|
|