showmount command provides information about shares on an NFS server. The mountd daemon maintains this information on the host.
The command queries the mountd daemon on a remote host for information about the state of the NFS server on that machine.
The default value for the host is the value returned by the hostname. With no options, show the clients that have mounted directories from the host. The
showmount command is usually found in
/usr/sbin, which is not in the default search path.
Showmount Command Options
The options available with the showmount command are as follows:
|Print all remote mounts in the format hostname:directory, where hostname is the name of the client and directory is the root of the filesystem that has been mounted.|
|List directories that clients have remotely mounted.|
|Print the list of exported filesystems.|
|Provide a short help summary.|
|–no-headers||Do not print headers.|
|Report the current version of the program.|
List of the Most Commonly Used Examples of showmount
To get the list of available options and usage of the command:
To list the remote mounts in the format
hostname is the name of the client and
directory is the root of the file system that has been mounted:
If you only want to list the directories mounted by remote clients, use the
showmount -d 192.168.1.10
To print the list of exported filesystems:
showmount -e 192.168.1.10
To remove the header from the showmount command output, use the
Get the version of the showmount command/package being used:
In conclusion, the information given by
showmount can sometimes include stale information about old mounts that are no longer present.
This can happen, for example, if a client reboots without unmounting the NFS mount. In this case, to correct this situation, you can, if necessary, remove the file
/var/lib/nfs/rmtab on the server and restart the NFS server.