Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2008-06-16
6
Medium Priority
?
1,047 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 4

Accepted Solution

by:
albuitra earned 1000 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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
LVL 4

Assisted Solution

by:albuitra
albuitra earned 1000 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

During and after that shift to cloud, one area that still poses a struggle for many organizations is what to do with their department file shares.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
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.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Suggested Courses

660 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