Solved

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

Posted on 2008-06-16
6
919 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Join & Write a Comment

The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
If your business is like most, chances are you still need to maintain a fax infrastructure for your staff. It’s hard to believe that a communication technology that was thriving in the mid-80s could still be an essential part of your team’s modern I…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

760 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

18 Experts available now in Live!

Get 1:1 Help Now