LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 09-29-2011, 07:19 AM   #1
devUnix
Member
 
Registered: Oct 2010
Location: Bengaluru, India
Distribution: RHEL 5.1 on My PC, & SunOS / Sun Solaris, RHEL, SuSe, Debian, FreeBSD and other Linux flavors @ Work
Posts: 549

Rep: Reputation: 46
Verifying NFS Mounts


Considering NFS Mount Points (Mounted Mount Points I mean) the following file

Code:
cat /proc/mounts
displays the currently mounted NFS mounts or does it display what we get by executing:

Code:
df
?

Purpose / Problem: I want to check (by stating each mount point (NFS only) to verify if it is working/available or not). Since I have N number of servers where N number of mount points are found on "/" and I see them in the output of:

Code:
cat /proc/mounts
as well as of:

Code:
df
I want to prepare a list of such NFS mount points found on each server so that I can further verify them.

A excerpt from the output of df follows here:

Code:
whatever-nfs:/pcs/mrt/000  71153664   6063136  64582016   9% /pcs/mrt/000
whatever-nfs01:/upload/002
                     712939520 677043392  35615712  96% /upload/002
whatever-nfs01:/upload/004
                     710837376 675037792  35519968  96% /upload/004
You see, the columns are not properly arranged since the first column name is too long, the next 5 columns are put on the second line. So, this will not help me:

Code:
df  | grep ":" | more
as it displays:


Code:
whatever-nfs:/pcs/mrt/000  71153664   6063136  64582016   9% /pcs/mrt/000
whatever-nfs01:/upload/002
whereas getting this list from /proc/mounts is very neat and clean combined with awk.


Code:
[lsdev@push02.sun3 Devarishi]$ cat /proc/mounts | grep ":"
WHATEVER:/vol/pcs_weblogs /pcs/weblogs nfs rw,vers=3,rsize=32768,wsize=32768,soft,intr,proto=tcp,timeo=600,retrans=2,sec=sys,addr=netapp08 0 0
pcs-nfs:/pcs/dist /pcs/dist nfs rw,vers=3,rsize=1048576,wsize=1048576,soft,intr,proto=tcp,timeo=600,retrans=2,sec=sys,addr=pcs-nfs 0 0
WHATEVER:/pcs/smsq /pcs/smsq nfs rw,vers=3,rsize=1048576,wsize=1048576,soft,intr,proto=tcp,timeo=600,retrans=2,sec=sys,addr=pcs-nfs 0 0
Code:
cat /proc/mounts | grep ":" | awk '{print $2}'
/pcs/weblogs
/pcs/dist
/pcs/smsq
The above output is not obtained from the output of "df" because of each long line splitting on next line.

Last edited by devUnix; 09-30-2011 at 03:06 AM.
 
Old 09-29-2011, 02:52 PM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,395
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
Uhh, is there a question in there somewhere?

--- rod.
 
Old 09-30-2011, 03:12 AM   #3
devUnix
Member
 
Registered: Oct 2010
Location: Bengaluru, India
Distribution: RHEL 5.1 on My PC, & SunOS / Sun Solaris, RHEL, SuSe, Debian, FreeBSD and other Linux flavors @ Work
Posts: 549

Original Poster
Rep: Reputation: 46
Quote:
Originally Posted by theNbomr View Post
Uhh, is there a question in there somewhere?

--- rod.
It is a Problem Statement. Not a direct question, I agree, though. But let me make you understand it in a nutshell:

How to check / verify each NFS Mount Point on each specific client box whether it (the NFS Mount Point) is available or not?

Or how to prepare a list of NFS Mount Points that may or may not be working / accessible? Will /proc/mounts or the output of "df" give you the answer?
 
Old 09-30-2011, 12:14 PM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,395
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
From my experience, only attempting to access an apparently mounted file or directory will reveal whether the mount is alive. This will usually result in a long delay while the connection times out, if the mount is not alive. I'm not aware of any other mechanism to determine the 'aliveness'.

--- rod.
 
Old 10-11-2011, 10:49 AM   #5
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 11.4
Posts: 1,319

Rep: Reputation: 252Reputation: 252Reputation: 252
Quote:
Originally Posted by devUnix View Post
How to check / verify each NFS Mount Point on each specific client box whether it (the NFS Mount Point) is available or not?
There is also the command:
Code:
$ mountpoint /opt
 
1 members found this post helpful.
Old 10-28-2011, 09:56 AM   #6
devUnix
Member
 
Registered: Oct 2010
Location: Bengaluru, India
Distribution: RHEL 5.1 on My PC, & SunOS / Sun Solaris, RHEL, SuSe, Debian, FreeBSD and other Linux flavors @ Work
Posts: 549

Original Poster
Rep: Reputation: 46
Quote:
Originally Posted by Reuti View Post
There is also the command:
Code:
$ mountpoint /opt
Code:
[demo@localhost ~]$ mountpoint /opt
/opt is not a mountpoint
[demo@localhost ~]$ mountpoint /
/ is a mountpoint
[demo@localhost ~]$ mountpoint /proc
/proc is a mountpoint
[demo@localhost ~]$

Thanks for the command!
 
Old 10-28-2011, 11:10 AM   #7
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,395
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
So, I guess I misunderstood what you mean by 'available'. I took it to mean that the NFS connection is alive and communicating; ie the server is serving (since you specifially mention NFS mounts). I don't think the mountpoint command tells you anything about the health of the connection.
--- rod.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] is there a way to monitor NFS mounts? recomboDNA Linux - Server 2 07-30-2010 10:55 AM
nfs mounts read permissions Tinku Linux - General 5 01-26-2006 01:54 AM
Backgrounding NFS mounts kaplan71 Linux - Networking 1 05-18-2005 04:50 PM
NFS SMB common mounts greno Linux - Networking 1 06-02-2004 05:51 PM
cannot get nfs mounts to work iggymac Linux - Networking 0 08-10-2001 01:58 PM


All times are GMT -5. The time now is 06:31 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration