目录
1.服务介绍
系统:centos 6.5
2.服务端的配置
安装必须的yum包:
yum -y install nfs-utils rpcbind
创建共享目录:
mkdir /opt/nfs
编辑/etc/exports,注意IP地址和权限配置之间没有空格:
vim /etc/exports
#10.0.0网段的都可以访问
/opt/nfs 10.0.0.0/24(rw,sync,root_squash)
启动服务,并设置开机启动
service rpcbind start
service nfs start
chkconfig --level 2345 rpcbind on
chkconfig --level 2345 nfs on
3.客户端配置
安装必须的yum包:
yum -y install nfs-utils rpcbind
创建目录:
mkdir /opt/nfs
查看服务端共享的目录:
showmount -e 服务端ip
挂载共享目录到本地,并测试读写:
mount -t nfs 服务端ip:/opt/nfs /opt/nfs
cd /opt/nfs
touch a
设置开机自动挂载:
vim /etc/fstab
添加一行
服务端ip:/opt/nfs /opt/nfs nfs defaults 0 0
4.其他
1)取消挂载
强制取消挂载
umount -lf /opt/nfs