标签:
//!!服务端设置 [root@localhost ~]# yum install -y nfs-utils rpcbind [root@localhost ~]# vim /etc/exports /*加入下列内容 第一段为共享出去的文件夹 第二段ip为client端的ip 第三段括号里的为权限*/ /home/ 192.168.137.0/24(rw,sync,all_squash,anonuid=501,anongid=501) //以下的顺序不可以换 [root@localhost ~]# /etc/init.d/rpcbind start; [root@localhost ~]# /etc/init.d/nfs start //查看已共享的什么目录,此处ip为服务端ip //查看方法1 [root@localhost ~]# showmount -e 192.168.137.10 Export list for 192.168.137.10 /home 192.168.137.0/24 //查看方法2 [root@localhost ~]# exportfs -arv exporting 192.168.137.0/24:/home //!!客户端设置 [root@localhost ~]# yum install -y nfs-utils rpcbind //挂载有2种方法,请任选其一 //挂载方法1 [root@localhost ~]# mount -t nfs -o nolock (nfsvers=3) 192.168.137.10:/home/ /mnt/ //挂载方法2 [root@localhost ~]# mkdir /test [root@localhost ~]# vim /etc/fstab //加入 ... ... 192.168.137.10:/tmp/ /test nfs nolock 0 0 ... ... //让挂载生效 [root@localhost ~]# mount -a //查看已挂载上 [root@localhost ~]# df -h
标签:
原文地址:http://www.cnblogs.com/frankielf0921/p/5380293.html