1833313 Members
2911 Online
110051 Solutions
New Discussion

Re: NFS mounting problem

 
Ryan Ma
Frequent Advisor

NFS mounting problem

I have several questions:

1. How to verify/test that the NFS mount point is mounted (using command)?
2. How can the system keep the mounting relationship when server reboot?
3. How can the system keep the mounting relationship when client reboot?

My client is under firewall DMZ. The NFS mount point is not mounted after reboot. Here is my setting:
Retry Mount: While foreground process waits (fg)
Mount Failure Retries (retry): 1

Is the setting correct?
8 REPLIES 8
Patrick Wallek
Honored Contributor

Re: NFS mounting problem

1. How to verify/test that the NFS mount point is mounted (using command)?

>>>If you do a 'bdf' all NFS mounts will be shown.

2. How can the system keep the mounting relationship when server reboot?

>>>See 'man mount_nfs' for information on 'hard' and 'soft' mount optoins.

3. How can the system keep the mounting relationship when client reboot?

>>>Have the NFS mount set up in /etc/fstab so that it mounts automatically on reboot.
Ryan Ma
Frequent Advisor

Re: NFS mounting problem

>>>If you do a 'bdf' all NFS mounts will be shown.
I know that bdf will show all NFS mounts. But as I know if the server is down, the bdf command will halt. So is that I have to write a script to kill the bdf for certain when writting health check script?

>>>See 'man mount_nfs' for information on 'hard' and 'soft' mount optoins.
May be soft mount is more suitable.
Is it usual using soft?

>>>Have the NFS mount set up in /etc/fstab so that it mounts automatically on reboot.
There is already an entry like this:
server:/nfsmnt /nfsmnt nfs rw,suid 0 0
I donno if it is the case that my machine is in DMZ. It just doesn't work. When the client is boot up, it do not mount the NFS automatically.
Helen French
Honored Contributor

Re: NFS mounting problem

Hi Ryan,

1) IF the bdf hangs when trying for an NFS mount, you have to kill the process in your script. If you are using a soft link, the system will not wait for the server's answer for indefenite period ( will error out). Another option is before doing a bdf, you can check whether the server is alive or not and thus avoiding any hang ups.

2) Using soft or hard mounts, is depend on your requirement. Both have it's own advantages. Check this thread for more useful information:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xce7db47b9a27d6118ff40090279cd0f9,00.html

3) For the third question, you have to point out the reason why it's not mounting. Some options are:

a) Check /etc/rc.log for any errors after NFS server and client startups ( eg: RPC errors)
b) Try manually mounting the file system after the system boots up

mount hostname:/directory /mount_point

Then check the entry in the /etc/mnttab file and enter the same entry in /etc/fstab. Then add your additional options with that.

HTH,
Shiju
Life is a promise, fulfill it!
A. Clay Stephenson
Acclaimed Contributor

Re: NFS mounting problem

Hi Ryan:

A rather elegant way to approach your problem is to call 'bdf -t nfs' from within a Perl script with an alarm signal handler. If it succeeds, it cancels the alarm and prints the bdf output on stdout and returns a zero exit status to your calling shell script; if it does not complete within 20 seconds, it sends an alarm and this triggers the signal handler to kill the process. You parent shell script then sees a non-zero exit status. This is just what you need and this approach very closely matches how one would do this is C. You can do the same sort of thing with a background process in the shell but the Perl method is much cleaner. You have a method of testing that does not 'hang' the system.

Food for thought, Clay
If it ain't broke, I can fix that.

Re: NFS mounting problem

Don't muck around with bdf - use mount -p which will tell you if the file system is mounted, but won't hang.

HTH

Duncan

I am an HPE Employee
Accept or Kudo
Ryan Ma
Frequent Advisor

Re: NFS mounting problem

Hi Shiju,

Thanks for your information.

1) Here is my script.
#!/bin/sh

bdf &
sleep 15
if [ ! -z `ps -ef | grep $$ | grep bdf` ]
then
ps -ef | grep $$ | grep bdf | awk '{ print $2 }' | xargs kill -9
echo "NFS not responding"
fi

2) After reading the link of using soft/hard mount, I decide to use hard mount.

3a) I have checked /etc/rc.log. There is no obvious information showing mount problem.
Here is some suspection.

************ /etc/rc.log **************

starting up the Automount daemon
/usr/sbin/automount -f /etc/auto_master
mounting remote NFS file systems ...
Permission denied
FAILURE CODE: 1
Mount failed! Possible local filesystem mount.
If local filesystem, then nfs.server will mount it.

.....

Start NFS server subsystem
Output from "/sbin/rc3.d/S100nfs.server start":
----------------------------
starting NFS SERVER networking

starting up the rpcbind daemon
rpcbind already started, using pid: 534
Reading in /etc/exports
starting up the mount daemon
/usr/sbin/rpc.mountd
starting up the NFS daemons
/usr/sbin/nfsd 4
starting up the Status Monitor daemon
rpc.statd already started, using pid: 570
starting up the Lock Manager daemon
rpc.lockd already started, using pid: 576

************ /etc/rc.log **************

3b) I found that the entry in /etc/mnttab and /etc/fstab is different. I will try to replace the entry in /etc/fstab by the entry in /etc/mnttab

************ /etc/mnttab **************
server:/nfs_mnt /nfsmnt nfs defaults,NFSv3 0 0 1014323286

************ /etc/fstab **************
server:/nfs_mnt /nfs_mnt nfs rw,suid 0 0

Rgds,
Ryan
Ryan Ma
Frequent Advisor

Re: NFS mounting problem

Clay,

I will try to use perl if I have time since I am not familiar with perl.

Rgds,
Ryan
Ryan Ma
Frequent Advisor

Re: NFS mounting problem

Duncan,

I will try mount -p later, since I cannot simulate the case when server is rebooted.

Rgds,
Ryan