Sunday, April 22, 2012

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

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

No comments:

Post a Comment