As a classic file
system,NFS played an important part in unix system.In this acticle I
will introduce how to use NFS including configuring NFS server and
client.

NFS Server:

In the console,you can use dfshares to the existing NFS server shared directory.

# dfshares


nfs dfshares:solariss: RPC: Program not registered

because nfs is based on RPC(Remote procedure call),you must register RPC first,such as the command below:

#/usr/lib/nfs/mountd

Start NFS server(it is active by default):

#svcadm enable network/nfs/server     (you can also stop it by: #svcadm disable network/nfs/server)

Set share directory on NFS Server

#share -F nfs -o ro=solariss /cdrom

 
NFS Client:

In order to share NFS server resource,you must start the nfs service at the client:
list nfs service:

# svcs | grep nfs
online         15:43:28 svc:/network/nfs/rquota:default
online         15:43:29 svc:/network/nfs/mapid:default
online         15:43:29 svc:/network/nfs/status:default
online         15:43:31 svc:/network/nfs/nlockmgr:default
online         15:43:33 svc:/network/nfs/server:default

Check the shared directory:

# showmount -e
swustcs 的导出列表:
/cdrom swustcs

create a directory to mount shared directory:

# mkdir /nfstest

 
mount the shared directory to local directory:

# mount -F nfs solariss:/cdrom /nfstest

read the directory:

# ls /nfstest
cdrom0      sol_11_x86
# ls /nfstest/sol_11_x86
autorun.inf                  JDS-THIRDPARTYLICENSEREADME
autorun.sh                   License
boot                         README.txt
Copyright                    sddtool
DeveloperTools               Solaris_11
installer
#


umount the shared directory:

# umount /nfstest
# ls /nfstest