Redhat – showmount -e nfs_server_hostname does not show all the available mounts for a client, but why

command-line-interfacemountnetwork-sharenfsredhat

NFS_Server is a DataDomain
Client is RHEL 7.3

I run a below command to show available NFS shared for my client system from NFS_server, however, I do not see all the share available to mount.

# showmount -e nfs_server_hostname
/test myclientsIP

# showmount -e nfs_server_IP
/test myclientsIP

In my case, I wanted a particular mount which was not showing in the results of above command.

still as DataDomain (which is a NFS_Server, in our case here) person told me to mount a particular share even if you don't see it in the output of showmount command above.

and for my surprise it got mounted, hence I ran above command again and still it was not showing in the list. but when I checked output of below command it was surprising for me.

# df -h
.
.
.
NFS_Server_IP:/test_Rep /mnt

I want to know the reason why it's happening and is there any other command to list such mount points which are hidden otherwise?

Thanks in advance and apologies for poor English & if this is not the right site for such a question.

Best Answer

The showmount command makes specific use of certain facets of the NFSv3 protocol to query the server and return a list of available shares. There are two ways to run showmount:

showmount -a - from the man page for showmount:

-a or --all List both the client hostname or IP address and mounted directory in host:dir format. This info should not be considered reliable. See the notes on rmtab in rpc.mountd(8).

In this case showmount is querying rpc.mountd on the server, which may or may not return a reliable list of mount points. The issue mentioned with rpc.mountd is that it is possible for stale entries to be left in the rmtab file, meaning it may not be an accurate list of mount points.

showmount -e - whilst the documentation for showmount suggests this to be the more reliable way to query the server, it makes specific use of this part of the NFSv3 protocol:

https://www.rfc-editor.org/rfc/rfc1813#section-5.2.5

This is part of the NFSv3 protocol, but does not exist in NFSv4. Many servers will configure NFS shares to be simultaneously available through NFSv3 and NFSv4, hence they show up using the showmount facility. However if a share is configured to be purely NFSv4 then showmount will not be able to get a list as the protocol doesn't provide a method to support this.

Even if the share is not pure NFSv4, the remote server must know to return the export in one (or both) of the two aforementioned ways for showmount to return it. This however would not prevent it from being mounted as you have experienced.