Results 11 to 17 of 17
Originally Posted by sjremya Hi I have selected rc.local method. I tested the rc.local file manually by starting it in the command prompt as shown here : # /etc/rc.d/rc.local & ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 08-31-2010 #11
- 08-31-2010 #12
I am not sure whether i can use rc.local or not[ bcoz my file system doesnot have an rc.conf file to control rc.local]
What i did as of now , i ll describe here
1. Created /etc/rc.local and added mount -t -o nolock <mount_distant-machine> <my-mount_point>
2. Added /etc/rc.local & in /etc/init.d/rcS file, but it did not execute the mount command from rc.local [ other echo messages are printing correctly. so i guess , problem is only with mount command. ]
3. after boot up [ i mean, after initializing all devices especially NETWORK ] , i ran manually /etc/rc.local & in command prompt. ITS working and MOUNTING filesystem.
Here is my question ? How to mount this NFS after initializing network? where to add my mount command to achieve this.
- 08-31-2010 #13
so, you will need to create a script that mounts NFS shares and put it into the correct rcX.d directory
basically all the script needs to contain is this line
/bin/mount -a -t nfs,nfs4
typically the scripts that go in rcX.d are executed in order by name, so you will have to make sure your script gets executed after network init by naming it in the right way
- 08-31-2010 #14
You do not add a command to run it from somewhere yourself. This may be your problem. If it still fails then it may be because networking is not fully established when it runs so you may need to put a delay as the first command in it so it waits a while
- 08-31-2010 #15
This is what I have in /etc/fstab on my Ubuntu system and I do not need any other commands for it to get mounted:
192.168.1.72:/home/nfsuser /home/nfsshare nfs rw,bg,hard,intr 0 0
At startup it is reported that it cannot be mounted but note from man nfs:
soft / hard Determines the recovery behavior of the NFS client after an NFS request times out. If neither option is specified (or if the hard option is specified), NFS requests are retried indefinitely. If the soft option is specified, then the NFS client fails an NFS
request after retrans retransmissions have been sent, causing the NFS client to return an error to the calling application.
bg / fg Determines how the mount command behaves if an attempt to mount an export fails. The fg option causes mount to exit with an error status if any part of the mount request times out or fails outright. This is called a "foreground" mount, and is the default behavior if neither the fg nor bg mount option is specified.
If the bg option is specified, a timeout or failure causes the mount command to fork a child which continues to attempt to mount the export. The parent immediately returns with a zero exit code. This is known as a "background" mount.
- 09-01-2010 #16
I would like to mention one more thing here.
My distribution is open suse. I could not find rc.local or boot.local file( where we can add local commands) in its /etc/ directory. So I want to use only /etc/fstab modificatiion to achieve NFS mounting .
But I feel /etc/fstab is not running before network fires up. So NFS is failing. How to make it sure that my network is working properly ?
- 09-01-2010 #17
Happy to say that i solved NFS mounting problem in system boot up . Thank you all for your valuable suggestions.
It was a simple network problem.
When I tried to mount NFS in /etc/init.d/rcs, network was not initialized properly. I have changed the position of network bringup to top (ifconfig eth0 <ip_addr> netmask <net_mask> up) in /etc/rc.d/rcS and gave some delay to establish network. At last i did NFS mounting using mount command.
mount -t nfs -o nolock <distant_machine> <my_mnt_pint> . It works fine.
But I wasted my time to look into fstab file to implement it . It is so easy to implement in rcS file.