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 192.168.1.12 and port is 2049, enter:
netstat -an | grep 192.168.1.12:2049
Sample outputs:
tcp 0 0 192.168.1.12:2049 192.168.1.5:757 ESTABLISHED tcp 0 0 192.168.1.12:2049 192.168.1.6:892 ESTABLISHED
Where,
- 192.168.1.12 - NFS serer IP address
- 2049 - NFS server port
- 192.168.1.5 and 192.168.1.6 - 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: 192.168.1.101:/volume1/data 192.168.1.102:/volume1/data 192.168.1.103:/volume1/data 192.168.1.5:/volume1/data 192.168.1.6:/volume1/data
Where,
- -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.
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop






![Linux / Unix: Show Shares on NFS Server [ Shared Directories ]](http://s13.cyberciti.org/images/shared/rp/3/10.jpg)







{ 2 comments… read them below or add one }
I’m using for that nfswatch commad.
The “netstat -an | grep” method won’t work if your NFS clients have been idle for a long time