首先安装NFS套件,命令如下:
yum
yum
然后安装portmap服务,portmap在centos6中改名为rpcbind
yum
yum
挂载光盘,将文件拷贝到要挂载的目录上
mkdir
mount
cp
配置nfs服务端
vi
添加
/opt/centos6
这一行表明本机的/opt/centos6这个目录为nfs共享目录,可访问的ip地址区间为192.168.0.0-192.168.0.254,权限为只读,当访问者为root用户时方位该目录具有root权限
重启nfs服务
/etc/init.d/rpcbind
/etc/init.d/nfs
将nfs加入开机启动项
chkconfig
客户端配置
查看是否能访问nfs服务
showmount
显示如下:
Export list for 192.168.0.10:
/opt/centos6 192.168.0.11
表示可以访问,如不可访问查看nfs服务端nfs服务是否启用,防火墙是否允许通过。
挂载nfs目录
mkdir
mount
配置开机自动挂载
vi
添加
192.168.0.10:/opt/centos6 /opt/centos6 nfs