在NFS客户端和服务器端编辑hosts文件
10.0.2.10 nfsserver10.0.2.15 nfsclient
在客户端和服务器端启动NFS
#startsrc -g nfs
#startsrc -s portmap
#lssrc -g nfs
在服务器端编译exports文件
#vi /etc/exports
#cat /etc/exports
/backup -rw
#
关闭nfs服务
# rmnfs 0513-095 The request for subsystem refresh was completed successfully. 0513-044 The biod Subsystem was requested to stop. 0513-044 The nfsd Subsystem was requested to stop. 0513-044 The rpc.mountd Subsystem was requested to stop. 0513-044 The rpc.lockd Subsystem was requested to stop. 0513-044 The rpc.statd Subsystem was requested to stop. 0513-004 The Subsystem or Group, ypbind, is currently inoperative. 0513-004 The Subsystem or Group, keyserv, is currently inoperative. 0513-004 The Subsystem or Group, nfsrgyd, is currently inoperative. 0513-004 The Subsystem or Group, gssd, is currently inoperative. #
启动nfs服务
# mknfs 0513-029 The portmap Subsystem is already active. Multiple instances are not supported. Starting NFS services: 0513-059 The biod Subsystem has been started. Subsystem PID is 23134400. 0513-059 The nfsd Subsystem has been started. Subsystem PID is 31719594. 0513-059 The rpc.mountd Subsystem has been started. Subsystem PID is 30867670. 0513-059 The rpc.statd Subsystem has been started. Subsystem PID is 31129724. 0513-059 The rpc.lockd Subsystem has been started. Subsystem PID is 28049420. Completed NFS services. 0513-095 The request for subsystem refresh was completed successfully. #
查看export
# lsnfsexp /backup -rw # exportfs /backup -rw # showmount -e 10.0.2.15 export list for 10.0.2.15: /backup (everyone) #
在NFS客户端
# showmount -e 10.0.2.15 export list for 10.0.2.15: /backup (everyone) # # mount -v nfs -o rw 10.0.2.15:/backup /backup # df -g Filesystem GB blocks Free %Used Iused %Iused Mounted on /dev/hd4 10.00 5.66 44% 31367 3% / /dev/hd2 5.00 3.16 37% 40702 6% /usr /dev/hd9var 5.00 4.74 6% 7230 1% /var /dev/hd3 10.00 9.75 3% 841 1% /tmp /dev/fwdump 1.00 0.98 2% 20 1% /var/adm/ras/platform /dev/hd1 10.00 6.27 38% 4635 1% /home /dev/hd11admin 0.25 0.25 1% 5 1% /admin /proc - - - - - /proc /dev/hd10opt 5.00 4.72 6% 8488 1% /opt /dev/livedump 0.25 0.25 1% 4 1% /var/adm/ras/livedump /dev/fslv00 1958.00 1738.04 12% 70 1% /oradata 10.0.2.15:/backup 3900.00 2212.94 18% 113014 1% /backup #