Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to determine clients that are mounting an NFS share?

5,055 views
Skip to first unread message

Jim Leonard

unread,
May 5, 2011, 11:46:25 AM5/5/11
to
I want to lock down an open NFS share to only those clients that
really need it. To narrow down that list, I'd like to determine the
clients that have the NFS share mounted, but can't figure out how to
do this using Solaris commands on the NFS server itself.

I suppose I can snoop NFS traffic on the NFS server for a week or so,
looking for client connections, but there has to be a more elegant way
to do this. Any suggestions?

cindy

unread,
May 5, 2011, 12:07:37 PM5/5/11
to

Hi Jim,

The command that provides information about clients that are
accessing NFS resources is dfmounts.

The syntax is like this:

# dfmounts nfs-server-name

Thanks,

Cindy

tkevans

unread,
May 5, 2011, 1:01:17 PM5/5/11
to

showmount (see the man page for details)

Jim Leonard

unread,
May 5, 2011, 1:23:00 PM5/5/11
to
On May 5, 11:07 am, cindy <cindy.swearin...@oracle.com> wrote:
> The command that provides information about clients that are
> accessing NFS resources is dfmounts.

"If dfmounts is entered without arguments, remote resources
currently mounted on the local system are displayed, regard-less of
file system type. However, the dfmounts command does not display the
names of NFS Version 4 clients."

My clients are NFSv4 so they are not showing up. Is there an
alternative?

Jim Leonard

unread,
May 5, 2011, 1:24:08 PM5/5/11
to
On May 5, 12:01 pm, tkevans <evanst...@gmail.com> wrote:
> showmount (see the man page for details)

"The showmount command does not display the names of NFS Version 4
clients." My clients are NFSv4.

Are there alternatives?

cindy

unread,
May 5, 2011, 1:56:06 PM5/5/11
to

I apologize. I was logged into a S11 system when I tested dfmounts an
showmount.
It looks to me like both commands display NFSv4 client info because we
run mostly
S10/S11 NFSv4 here.

I see that the man page that says otherwise but I also see a fixed CR
that makes
me unsure. I will look into this.

Thanks,

Cindy

Jim Leonard

unread,
May 5, 2011, 2:19:27 PM5/5/11
to
On May 5, 12:56 pm, cindy <cindy.swearin...@oracle.com> wrote:
> I apologize. I was logged into a S11 system when I tested dfmounts an
> showmount.
> It looks to me like both commands display NFSv4 client info because we
> run mostly
> S10/S11 NFSv4 here.

For reference, the systems I'm trying to attempt this on are sparc
S10u6.

bits45

unread,
May 5, 2011, 11:28:01 PM5/5/11
to

I've never known showmount to be reliable nor up-to-date with valid
information. It's always been a mystery to see accurate info on
mounted clients.

Sami Ketola

unread,
May 6, 2011, 4:09:32 AM5/6/11
to
bits45 <chris....@gmail.com> wrote:
> I've never known showmount to be reliable nor up-to-date with valid
> information. It's always been a mystery to see accurate info on
> mounted clients.

You can always try Eric Kustarz's get_nfs_clients.d DTrace scrip if that
does the job for you:

http://blogs.sun.com/erickustarz/entry/dscript_to_retrieve_active_nfs

Downside is that it only lists active nfs sessions.

Sami

Chris Ridd

unread,
May 6, 2011, 5:57:22 AM5/6/11
to

There are several NFS-related DTrace scripts up at
<http://www.dtracebook.com/> that may help, though I'm not sure if
they'll work on such an "old" version of Solaris.

--
Chris

tim....@gmail.com

unread,
May 6, 2011, 9:54:26 AM5/6/11
to
On May 6, 5:57 am, Chris Ridd <chrisr...@mac.com> wrote:
> On 2011-05-06 09:09:32 +0100, Sami Ketola said:
>

I was about to reply from summary when I saw the other DTrace script
mentions, here is another, looks like a different blog entry so it may
or may not be the same script... http://blogs.sun.com/erickustarz/date/20050503
"dscript to get active NFS clients / nfstop"

cindy

unread,
May 6, 2011, 12:26:23 PM5/6/11
to
On May 6, 7:54 am, "tim.w...@Inklingresearch.com" <tim.w...@gmail.com>
wrote:
> or may not be the same script...http://blogs.sun.com/erickustarz/date/20050503

> "dscript to get active NFS clients / nfstop"

Tim, didn't you get those dtrace script links from me? :-)

I think we should be able to get NFS client info without having to
resort to
a dtrace script.

I never got a response about any recent changes with showmount and
NFSv4
client info but on a current Solaris 10 system, I can use showmount to
see
s11 client systems. When I log into the client system, its running the
S11
release and nsstat says its running NFSv4. See below.

Sometimes, running showmount results in a rpcbind failure. I can't
figure out
what causes this.

On one S10 system, nothing is shared, but all the rcp services are
running.
I didn't make any changes and showmount works to see S11 NFSv4
clients.
See below.

However, I can't see S10/NFSv4 client info between two S10 systems nor
can I see S10/NFSv4 client info from an S11 NFSv4 system.

It looks to me like something in S11 NFS is providing this info, but I
don't
know for sure what it is.

Not much help...

Cindy

# share
# svcs | grep rpc
online Feb_11 svc:/network/rpc/bind:default
online Feb_11 svc:/network/rpc/keyserv:default
online Feb_11 svc:/network/rpc/gss:default
online Feb_11 svc:/network/rpc/rstat:default
online Feb_11 svc:/network/rpc/cde-calendar-manager:default
online Feb_11 svc:/network/rpc/cde-ttdbserver:tcp
online Feb_11 svc:/network/rpc/smserver:default
online Feb_11 svc:/network/rpc/rusers:default
online Feb_11 svc:/network/rpc-100235_1/
rpc_ticotsord:default
# showmount server-name
client-1
client-2
client-3

# ssh client-1
Last login: Thu May 5 15:20:29 2011 from sr1-ubrm-17.us.
Oracle Corporation SunOS 5.11 April 2011
# nfsstat -m | grep vers
Flags:
vers=4,proto=tcp,sec=sys,hard,intr,link,symlink,acl,rsize=1048576,wsize=1048576,retrans=10,timeo=600
Flags:
vers=4,proto=tcp,sec=sys,hard,intr,llock,link,symlink,acl,rsize=1048576,wsize=1048576,retrans=5,timeo=600
Flags:
vers=4,proto=tcp,sec=sys,hard,intr,link,symlink,acl,rsize=1048576,wsize=1048576,retrans=10,timeo=600
Flags:
vers=4,proto=tcp,sec=sys,hard,intr,link,symlink,acl,mirrormount,rsize=1048576,wsize=1048576,retrans=10,timeo=600
Flags:
vers=4,proto=tcp,sec=sys,hard,intr,link,symlink,acl,rsize=1048576,wsize=1048576,retrans=10,timeo=600
Flags:
vers=4,proto=tcp,sec=sys,hard,intr,link,symlink,acl,mirrormount,rsize=1048576,wsize=1048576,retrans=10,timeo=600
Flags:
vers=4,proto=tcp,sec=sys,hard,intr,link,symlink,acl,mirrormount,rsize=1048576,wsize=1048576,retrans=10,timeo=600


Casper H.S. Dik

unread,
May 7, 2011, 7:40:17 AM5/7/11
to
bits45 <chris....@gmail.com> writes:

>On May 5, 2:19=A0pm, Jim Leonard <mobyga...@gmail.com> wrote:


>> On May 5, 12:56=A0pm, cindy <cindy.swearin...@oracle.com> wrote:
>>
>> > I apologize. I was logged into a S11 system when I tested dfmounts an
>> > showmount.
>> > It looks to me like both commands display NFSv4 client info because we
>> > run mostly
>> > S10/S11 NFSv4 here.
>>
>> For reference, the systems I'm trying to attempt this on are sparc
>> S10u6.

>I've never known showmount to be reliable nor up-to-date with valid
>information. It's always been a mystery to see accurate info on
>mounted clients.

For nfsv2/3 you can use nfslogd; for nfsv4 I'm not sure, but I think
there should be some DTrace probe points you can use and agregate over
the clients.

Casper
--

Jim Leonard

unread,
May 9, 2011, 10:20:58 AM5/9/11
to
On May 6, 11:26 am, cindy <cindy.swearin...@oracle.com> wrote:
> However, I can't see S10/NFSv4 client info between two S10 systems nor
> can I see S10/NFSv4 client info from an S11 NFSv4 system.

My workaround has been to record the output of "netstat -an | grep
2049" once a minute, and hope that all the clients that need access
will do so during my sampling period.

0 new messages