`
zhaohaolin
  • 浏览: 984066 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

centos6.2下配置nfs

 
阅读更多

centos6.2变更了portmap服务为rpcbind,在使用nfs时这点与centos5不同,下面配置一个nfs系统,用来使局域网内的所有用户均可访问该目录,可将该目录配置成yum源,供内网机器安装软件。



首先安装NFS套件,命令如下:

yum install nfs-utils.x86_6464位系统

yum install nfs-utils(32位系统)

 

然后安装portmap服务,portmapcentos6中改名为rpcbind

yum install rpcbind(centos6)

yum install portmap(centos5)

 

挂载光盘,将文件拷贝到要挂载的目录上

mkdir /opt/centos6

mount  /dev/cdrom /media -o loop

cp -r /media/* /opt/centos6/

 

配置nfs服务端

vi /etc/exports

添加

/opt/centos6 192.168.0.0/24(ro,no_root_squash)

这一行表明本机的/opt/centos6这个目录为nfs共享目录,可访问的ip地址区间为192.168.0.0-192.168.0.254,权限为只读,当访问者为root用户时方位该目录具有root权限

 

重启nfs服务

/etc/init.d/rpcbind start

/etc/init.d/nfs start

 

nfs加入开机启动项

chkconfig nfs on

 

客户端配置

查看是否能访问nfs服务

showmount -e 192.168.0.10

显示如下:

 

Export list for 192.168.0.10:

/opt/centos6 192.168.0.11

 

表示可以访问,如不可访问查看nfs服务端nfs服务是否启用,防火墙是否允许通过。

 

挂载nfs目录

mkdir /opt/centos6

mount -t nfs 192.168.0.10:/opt/centos6/ /opt/centos6/

 

 

配置开机自动挂载

vi /etc/fstab

添加

192.168.0.10:/opt/centos6 /opt/centos6 nfs  nodev,ro,rsize=32768,wsize=32768    0 0

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics