Linux / Unix: Show Shares on NFS Server [ Shared Directories ]

by on April 20, 2012 · 1 comment· LAST UPDATED April 20, 2012

in

We have a few netapp and other Unix server running here. An NFS server is configured on both netapp and Unix. How do I see all exported file systems from netapp and unix server using Linux command line option?

You need to use the showmount command to see mount information for an NFS server. This command queries the mount daemon on a remote nfs host (netapp or unix nfs server) for information about the state of the NFS server on that machine. With no options passed the showmount command lists the set of clients who are mounting from that host. The output from showmount is designed to appear as though it were processed through sort -u command.

Display all exported file systems from an NFS server

Type the following command to list shared directories from an nfs server called nas03 (IP address 192.168.1.12):

WARNING! You must run 'showmount -e' command as the root user. Switch to the root user by typing su - and entering the root password, when prompted.

# showmount -e 192.168.1.12
OR use server name such as nas03 or netapp03 or filer03:
# showmount -e nas03
Sample outputs:

Export list for nas03:
/volume1/multimedia 192.168.1.0/24
/volume1/sales 192.168.1.0/24
/volume2/users 192.168.1.0/24

In this example /volume1/multimedia, /volume1/sales, and /volume1/users are shared on an NFS server. You can mount shared nfs directory called /volume1/multimedia from nas03 nfs server using the mount command, enter:
# mkdir /mnt/nfs
# mount -t nfs nas03:/volume1/multimedia /mnt/nfs

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 1 comment… read it below or add one }

1 jon April 26, 2012 at 10:46 pm

If you are on an SVR4-compliant version of Unix such as Solaris or AIX then you also have the dfshares and dfmounts commands available.

dfshares with no other parameters specified shows what you are exporting.

dfshares with a hostname or IP address shows what that NFS server is exporting.

dfmounts with no other parameters shows what NFS clients are mounting shares you are exporting.

dfmounts with a hostname or IP shows what NFS clients are mounting shares from the remote NFS server.

Don’t know whter Linux has gotten around to implementing these. I work almost exclusively on Solaris these days. When I previously worked on RedHat, they weren’t there then.

Reply

Leave a Comment

Tagged as: , , , , , , , , , , , , , , ,

Previous Faq:

Next Faq: