#mkdir /arm
#vim /etc/exprots
/arm *(rw) //*代表所有主機
#service nfs start
#service nfs stop
#service nfs restart
#service nfs status(服務狀態)
4.在客戶機上查看nfs的資源共享情況
我的主機IP爲192.168.1.20
#showmount -e 192.168.1.20Exprot list for 192.168.1.20
/arm *
5.使用mount命令掛載共享資源
mount -t nfs -o nolock 192.168.1.20:/arm /mnt
6.開機自動掛載
打開配置文件
vim /root/.bash_profile
將語句mount -t nfs -o nolock 192.168.1.20:/arm /mnt添加至文件尾即可
出現的問題與解決方法:
[root@FriendlyARM /]# mount -t nfs 192.168.1.20:/arm /mnt/
[ 442.150000] svc: failed to register lockdv1 RPC service (errno 111).
[ 442.150000] lockd_up: makesock failed, error=-111
mount: mounting 192.168.1.20:/arm on /mnt/ failed: Connection refused
解決方案:
nfs mount 默認選項包括文件鎖,依賴於protmap提供的動態端口分配功能
解決方法:kill 文件鎖(lockd) 或者 mount -o nolock