LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-24-2009, 10:54 AM   #1
thllgo
Member
 
Registered: Sep 2003
Location: Laurel MD
Posts: 296

Rep: Reputation: 32
check if NFS mount is OK without hanging


Hello,

Is there a way to check if an NFS mounted partition is OK and responding without hanging?

If you have an NFS mounted partition and the NFS server dies then everything I know how to check on an NFS mount is either old info or hangs. We have an application that copies files to an NFS mount and would like for it to be able to check to see if the mount is avail.

df hangs
stat -f hangs
grep /etc/mtab not accurate
grep /proc/mounts not accurate

The files mtab and mounts are not accurate because the NFS partition was mounted correctly but is no longer available because the NFS server died and those files will not have been updated.

Any help will be greatly appreciated
Thank you
 
Old 02-24-2009, 01:54 PM   #2
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
Quote:
Originally Posted by thllgo View Post
Hello,

Is there a way to check if an NFS mounted partition is OK and responding without hanging?

If you have an NFS mounted partition and the NFS server dies then everything I know how to check on an NFS mount is either old info or hangs. We have an application that copies files to an NFS mount and would like for it to be able to check to see if the mount is avail.

df hangs
stat -f hangs
grep /etc/mtab not accurate
grep /proc/mounts not accurate

The files mtab and mounts are not accurate because the NFS partition was mounted correctly but is no longer available because the NFS server died and those files will not have been updated.

Any help will be greatly appreciated
Thank you
If /proc/mounts isn't accurate you have a more serious issue of some sort. That *should* be accurate. Have you tried typing just "mount"?
 
Old 02-24-2009, 02:03 PM   #3
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by thllgo View Post
Is there a way to check if an NFS mounted partition is OK and responding without hanging?
You can run "df" or "stat" in the background and save the PID using "$!". Then you can use "sleep" and "wait" in a loop to wait until you are satisfied that the NFS mount is really not there.
 
Old 02-24-2009, 03:37 PM   #4
thllgo
Member
 
Registered: Sep 2003
Location: Laurel MD
Posts: 296

Original Poster
Rep: Reputation: 32
If /proc/mounts isn't accurate you have a more serious issue of some sort. That *should* be accurate. Have you tried typing just "mount"?

/proc/mounts isn't going to be updated because the client didn't umount the drive. The server died without informing anyone.
I have not tried just mount but I will.

You can run "df" or "stat" in the background and save the PID using "$!". Then you can use "sleep" and "wait" in a loop to wait until you are satisfied that the NFS mount is really not there.

I like this idea, I will try it.

Thank you
 
Old 02-24-2009, 04:09 PM   #5
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
Quote:
Originally Posted by thllgo View Post
If /proc/mounts isn't accurate you have a more serious issue of some sort. That *should* be accurate. Have you tried typing just "mount"?

/proc/mounts isn't going to be updated because the client didn't umount the drive. The server died without informing anyone.
I have not tried just mount but I will.

You can run "df" or "stat" in the background and save the PID using "$!". Then you can use "sleep" and "wait" in a loop to wait until you are satisfied that the NFS mount is really not there.

I like this idea, I will try it.

Thank you
Might be just be able to test for the existence of a file on the nfs, it may hang for a short while but should time out at worst. I don't currently have an nfs mount in front of me to test this with.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to mount a nfs mount from linux client to AIX nfs server dennyqian AIX 13 04-11-2016 11:30 PM
[SOLVED] mount.nfs: mount to NFS server 'rpcbind' failed w1k0 Slackware 4 03-30-2010 03:45 PM
NFS mount mount.nfs: access denied by server while mounting knockout_artist Linux - Newbie 2 11-26-2008 02:36 PM
DPKG over NFS hanging. NFS possible cause gosuperninja Linux - General 0 10-23-2007 10:50 PM
NFS Hanging kapilraj AIX 1 05-04-2004 05:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration