1、安装nfs 服务器(192.168.0.1)
apt-get install nfs-kernel-server
2、修改nfs配置文件:
vim /etc/exports
在exports文件中添加nfs共享目录:path-to-share *(rw,sync)
其中path-to-share是共享目录名称,可随意取名;*表示任一IP均可共享该目录,可自行修改;rw表示权限,sync是默认的;
3、重启nfs服务
/etc/init.d/nfs-kernel-server restart 重启 nfs 服务
4、在另一台机器上安装客户端,比如192.168.0.2
apt-get install nfs-common
查看nfs-server上共享的目录:showmount -e 192.168.0.1
创建共享挂载点,并进行挂载:
mkdir /path-to-mount,
mount -t nfs 192.168.xx.xx:/path-to-share /path-to-mount
5、在path-to-mount目录下新建一个文件夹test:mkdir test
到nfs服务器所在机器上,打开path-to-share,查看是否有test文件夹,有,则挂载成功。
原文:http://www.cnblogs.com/xiaoerlang/p/3546159.html