0

I have a storag server in my network, and the server exported several directories as NFS target. Such as /raid0/folderA, /data/after_2018, /data/shared_data and all of these targets allow any IP to mount it. Now I need to figure which server mounted which directory. Because all these use same listening port and NFS clients not always mounting all NFS target, so I can't only check TCP connection. Dose NFS server it self have any way to figure this out?
Thankyou in advance!

3
  • As far as I remember, the NFS server is stateless and doesn't remember who mounts anything. Why do you need to know which client mounted what? Commented Mar 22, 2021 at 7:02
  • I have a list about which server should mount which NFS target. And I have the privilege of NFS server, but due to some management reason I don't have access of every NFS client for now. But I need to observation if every NFS client mounting directories correctly.
    – fajin yu
    Commented Mar 22, 2021 at 14:17
  • Perhaps the database mentioned in serverfault.com/questions/831173/nfs4-how-to-log-mount-requests helps. Commented Mar 22, 2021 at 15:19

1 Answer 1

0

Run this command on NFS server

showmount -a 127.0.0.1

This will show mountpoints on NFS Clients in format IP:/mountpoint

Also you could run this command on any NFS client in format

showmount -a A.B.C.D

where A.B.C.D is NFS server address.

showmount command also knows options -d (List directories that have been remotely mounted by clients) and -e (Print the list of shared file systems)

1
  • 1
    Note that showmount may not show NFSv4 mountpoints at all, since NFSv4 won't use the NFSv3-and-older style mountd service, which the showmount command relies on. In server's /proc/fs/nfsd/clients/*/info you can see the NFSv4 clients' IP addresses, source ports, hostnames and "implementation names" (on Linux clients, essentially uname -a outputs) - but not which mountpoint(s) the client might be using.
    – telcoM
    Commented Jan 31 at 22:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .