≡ Menu

Linux / Unix Command To Find Out NFS Clients Connected To My NFS Server

How do I find out how many nfs clients are connected to NFS server running on Red Hat Enterprise Linux?

You can use the following commands. SSH or login into your nfs server and type the following command:

netstat -an | grep nfs.server.ip:port

If your nfs server IP address and port is 2049, enter:

netstat -an | grep

Sample outputs:

tcp        0      0         ESTABLISHED
tcp        0      0         ESTABLISHED


  • – NFS serer IP address
  • 2049 – NFS server port
  • and – NFS clients IP address

showmount command

You can to use the showmount command to see mount information for an NFS server. The following command should not be used as it may produce unreliable result (you can type this command on any one of the nfs client):

showmount -a nfs03

Sample outputs:

All mount points on nas03:


  • -a : List both the client hostname or IP address and mounted directory in host:dir format. This info should not be considered reliable.

More about /var/lib/nfs/rmtab file

The rmtab file is located at /var/lib/nfs/rmtab on nfs server and can be viewed using the cat command:

cat /var/lib/nfs/rmtab

From the rpc.mountd(8) man page:

The rpc.mountd daemon registers every successful MNT request by adding an entry to
the /var/lib/nfs/rmtab file. When receivng a UMNT request from an NFS client,
rpc.mountd simply removes the matching entry from /var/lib/nfs/rmtab, as long as
the access control list for that export allows that sender to access the export.

Clients can discover the list of file systems an NFS server is currently exporting,
or the list of other clients that have mounted its exports, by using the show-
mount(8) command. showmount(8) uses other procedures in the NFS MOUNT protocol to
report information about the server’s exported file systems.

Note, however, that there is little to guarantee that the contents of
/var/lib/nfs/rmtab are accurate. A client may continue accessing an export even
after invoking UMNT. If the client reboots without sending a UMNT request, stale
entries remain for that client in /var/lib/nfs/rmtab.

Share this tutorial on:

Your support makes a big difference:
I have a small favor to ask. More people are reading the nixCraft. Many of you block advertising which is your right, and advertising revenues are not sufficient to cover my operating costs. So you can see why I need to ask for your help. The nixCraft, takes a lot of my time and hard work to produce. If you use nixCraft, who likes it, helps me with donations:
Become a Supporter →    Make a contribution via Paypal/Bitcoin →   

Don't Miss Any Linux and Unix Tips

Get nixCraft in your inbox. It's free:

{ 6 comments… add one }
  • azg May 11, 2012, 5:17 am

    I’m using for that nfswatch commad.

  • Milos Kaurin March 4, 2013, 12:19 pm

    The “netstat -an | grep” method won’t work if your NFS clients have been idle for a long time

    • Eric May 24, 2016, 4:51 pm

      Either that is not true, or it is no longer true. Or… just not true in all situations (which is often the case). I just attempted the netstat|grep method on a server with a connected client that has been idle for 3 days and it showed right up.

  • Ian Nicholls June 30, 2016, 10:02 am

    More likely that will work depending on how its mounted

    Using autofs it would automatically unmount it after a period of inactivity

    Where as if its mounted via command prompt or /etc/fstab then it would stay mounted but idle

    And that would be the correct answer – as autofs idlers would NOT be mounted at that time :)

  • FreeSoftwareServers December 15, 2016, 5:09 pm

    This is a bit more portable IMO

    netstat -an | grep 2049 | grep “ESTABLISH”

  • ed February 16, 2017, 8:26 am

    out of topic,

    How can I unmount a client from may nfs server. Is there any command for that?
    Say, I have a client that is mounted to /volume1/data and I want to unmount it using my server as I don’t have any access to that client. Hope you can answer my question.


Security: Are you a robot or human?

Leave a Comment

You can use these HTML tags and attributes: <strong> <em> <pre> <code> <a href="" title="">

   Tagged with: , , , , , , , , , , , ,