码迷,mamicode.com
首页 > 系统相关 > 详细

[转]CENTOS LINUX安装并使用NFS共享文件

时间:2014-06-25 12:39:03      阅读:297      评论:0      收藏:0      [点我收藏+]

标签:style   http   tar   com   get   使用   

FROM : http://www.qiansw.com/centos-linux-nfs.html

NFS是linux常用的一种文件分享工具。

下面介绍安装及使用方法。

 

CentOS 5.5

yum -y install setup-*  initscripts-*  nfs-utils-*  portmap-*  quota-* chkconfig nfs on chkconfig portmap on service nfs restart service portmap restart

CentOS 6.3

yum -y install nfs-utils rpcbind chkconfig nfs on chkconfig rpcbind on service rpcbind restart service nfs restart

共享文件

以共享/var/ftp和/nfs目录为例:
编辑/etc/exports文件

/var/ftp 192.168.16.0/255.255.255.0(rw,no_root_squash) /nfs 192.168.16.0/255.255.255.0(ro,sync)

挂载共享

以挂载192.168.16.170上的nfs共享/nfs到本地/var/www/html为例:
编辑/etc/fstab文件,添加下面一行至末尾。

192.168.16.170:/nfs /var/www/html nfs defaults 0 0

然后执行下面命令进行挂载

mount -a

可以通过下面命令查看挂载情况

df -hT

[转]CENTOS LINUX安装并使用NFS共享文件,布布扣,bubuko.com

[转]CENTOS LINUX安装并使用NFS共享文件

标签:style   http   tar   com   get   使用   

原文地址:http://www.cnblogs.com/Athrun/p/centos-linux-nfs.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!