Solved

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

Posted on 2008-06-16
6
932 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

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…
When you try to share a printer , you may receive one of the following error messages. Error message when you use the Add Printer Wizard to share a printer: Windows could not share your printer. Operation could not be completed (Error 0x000006…
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…
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…

785 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