#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