Solved

NFS STALE MOUNTS ON CLIENTS - CAN I DETECT THESE FROM THE SERVER

Posted on 2008-06-16
6
923 Views
Last Modified: 2013-12-19
Hey all,

We have a Red Hat 5.1 cluster connecting to a GFS filesystem on a SAN.  We are experiencing difficulties with the cluster regularly and it tends to crash and not always failover properly.  We are attempting to deal with these machine panics, but in the meantime we are ending up finding lots of stale NFS mounts on client servers that are a pain to find - Generally only find them when the user comes to us and they ain't happy at that point.

What I was hoping to do was to have a utility or perhaps a script that can check any mounts from clients to see if they are considered stale or not after a crash occurs.  That way if I could generate a list of stale mounts then I can manually sort them out prior to the user seeing the problems.

If anyone knows of such a utility or has such a script I would be much in your debt.

Thanks in advance

0
Comment
Question by:Helenkinsella
  • 4
  • 2
6 Comments
 
LVL 4

Accepted Solution

by:
albuitra earned 500 total points
ID: 21795429
showmount -a
this shows all mounts for a NFS share
0
 

Author Comment

by:Helenkinsella
ID: 21795847
Thanks for the comment albuitra - Alas there can be as many as 600 servers connected to the NFS share at  any one time (and generally are) - It is true evil to have to check every server/client so what I was   hoping to do was get a list of which mounts have gone stale - It is possible that the server cannot check this so perhaps a script taking the list of servers from a mount -a command or from the /var/lib/nfs/rmtab file might do the trick -

Even better still if someone already had such a script or a utility existed to check the mounts.  Also to test 600 servers remotely may not help network traffic too much but sure you never know till you try........
0
 

Author Comment

by:Helenkinsella
ID: 21796362
Here is something I found which may work although it would be as a crontab on all the clients so may take a while to implement - What would be great  is something that could be checked from the server side.

#! /bin/sh
#
# checkmounts
#
# Clear stale nfs mounts
#
# This script should be run periodically from crontab
#
# Unmount all the stale mounts
for m in `df -k 2>&1 | grep Stale | awk -F: '{print $1}' `
do
     echo Dismounting stale $m on `hostname`
     /usr/sbin/umount $m
done

# Remount those specified in fstab
/usr/sbin/mountall -F nfs

# End of script

0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 4

Assisted Solution

by:albuitra
albuitra earned 500 total points
ID: 21796405
In the NFS server you can't know the state of every client.
You would need an access from the server to every machine, like root, and that is a very bad practice in security.
So maybe you can think in migrate to AFS
http://www.openafs.org/ 
0
 

Author Comment

by:Helenkinsella
ID: 21796440
Thanks albuitra - Way too big an environment to move over to AFS at this time - The real issue is the cluster crashing and not offering redundancy - If the cluster was working correctly then the mounts would not go stale in the first place - The script is a little simple as a df will not always show if the mount is stale and the umount sometimes needs the -f to force it - Not always available outside Solaris and we have multiple UX's
0
 

Author Comment

by:Helenkinsella
ID: 21905628
Reckon there may not be such a utility - Thanks for taking the time to respond albuitra - I have begun looking into Nagios and trying to find a stale NFS plugin for it - Once rolled out this may be the best approach.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you're not part of the solution, you're part of the problem.   Tips on how to secure IoT devices, even the dumbest ones, so they can't be used as part of a DDoS botnet.  Use PRTG Network Monitor as one of the building blocks, to detect unusual…
When it comes to security, there are always trade-offs between security and convenience/ease of administration. This article examines some of the main pros and cons of using key authentication vs password authentication for hosting an SFTP server.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now