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

相关文章:

  • 2021-07-27
  • 2021-12-19
  • 2021-07-23
  • 2021-07-31
  • 2021-12-07
  • 2022-01-17
猜你喜欢
  • 2022-12-23
  • 2022-02-18
  • 2021-12-28
  • 2021-12-17
  • 2021-10-29
  • 2021-09-25
相关资源
相似解决方案