首页 > 代码库 > Netapp exportfs NFS Config CLI Guide

Netapp exportfs NFS Config CLI Guide

Netapp exportfs NFS Config CLI Guide

A quick and simple Netapp NFS configuration guide with commands and options to help explain and remove the mysteries. Netapps provide highly dependable NFS services, as the name implies, it’s a network appliance. You really can just turn it on and not worry much about outages. Unless someone trips on a power chord or two. Below is a compilation of exporfs and exports configuration options commonly used.

Rules for exporting Resources

? Specify complete pathname, meaning the path must begin with a /vol prefix
? You cannot export /vol, which is not a pathname to a file, directory or volume. Export each volume separately
? When export a resource to multiple targets, separate the target names with a colon (:) Resolve hostnames using DNS, NIS or /etc/hosts per order in /etc/nssswitch.conf

Access restrictions that specify what operations an NFS client can perform on a resource

? Default is read-write (rw) and UNIX Auth_SYS (sys) security
? “ro” option provides read-ony access to all hosts
? “ro=” option provides read-only access to specified hosts
? “rw=” option provides read-write access to specified hosts
? “root=” option specifies that root on the target has root permissions

Examples to export resources with NFS on the CLI
> exportfs -a
> exportfs -o rw=host1:host2 /vol/volxyz

Exportable resources are by Volume Directory/Qtree File. Target examples from /etc/exports Host – use name of IP address

/vol/vol0/home -rw=myhost
/vol/vol0/home -root=myhost,-rw=hishost,therehost
# Netgroup – use the NIS group name – Although I love NIS, NIS is rare nowadays. But the Netapp supports NIS. Don’t think NIS+.
/vol/vol0/home -rw=the-nisgroup

# Subnet – specify the subnet address
/vol/vol0/home -rw=”192.168.100.0/24″

# DNS – use DNS subdomain
/vol/vol0/home -rw=”.sap.dev.mydomain.com”

# Command to displays all current export in memory
> exportfs

# To export all file system paths specified in the /etc/exports file.
> exportfs -a
Adds exports to the /etc/exports file and in memory.  Default export options are “rw” (all hosts) and “sec=sys”.
> exportfs -p [options] path

> exports -p rw=hostxyz /vol/vol2/sap

# To export a file system path temporarly without adding a corresponding entry to the /etc/exports file.
> exporfs -i -o ro=hostB /vol/vol1/lun2


# Reloads the exports from /etc/exports files
> exportfs -r


# Unexports all exports defined in the /etc/exports file
> exportfs -uav
# Unexports a specific export
> exportfs -u /vol/vol2/homes
# Unexports an export and removes it from /etc/exports file. This one is handy.
> exportfs -z /vol/vol0/home

# To verify the actual path to which a volume is exported
> exportfs -s /vol/vol2/vms-data
# To display list of clients mounting from the storage system
> showmount -a filerabc

# To display list of exported resources on the storage system
>showmount -e filerabc

# To check NFS target to access cache
> exportfs -c clientaddr path [accesstype] [securitytype]
> exportfs -c host1 /vol/vol2 rw
# To remove entries from access cache
> exportfs -f [path]
# Flush the access cache.
> exportfs -f