nfs服务器搭建
1.安装nfs服务器
sudo apt-get install nfs-kernel-server
2.设置/etc/exports配置文件
sudo vi /etc/exports
添加这行配置
/home/用户名/nfs *(rw,sync,no_root_squash)
3.在用户目录下创建nfs目录
mkdir /home/用户名/nfs
4.重启服务器,重新加载配置文件
sudo /etc/init.d/nfs-kernel-server restart
5.在/home/用户名/nfs目录下创建测试文件hello
cd /home/用户名/nfs
touch hello
6.测试服务器,把服务器共享目录nfs挂在到/mnt节点
sudo mount -t nfs -o nolock -o tcp IP:/home/用户名/nfs /mnt
7.进入/mnt目录可以看到hello文件,表示构建成功
8.卸载网络共享目录
sudo umount /mnt
1.安装nfs服务器
sudo apt-get install nfs-kernel-server
2.设置/etc/exports配置文件
sudo vi /etc/exports
添加这行配置
/home/用户名/nfs *(rw,sync,no_root_squash)
3.在用户目录下创建nfs目录
mkdir /home/用户名/nfs
4.重启服务器,重新加载配置文件
sudo /etc/init.d/nfs-kernel-server restart
5.在/home/用户名/nfs目录下创建测试文件hello
cd /home/用户名/nfs
touch hello
6.测试服务器,把服务器共享目录nfs挂在到/mnt节点
sudo mount -t nfs -o nolock -o tcp IP:/home/用户名/nfs /mnt
7.进入/mnt目录可以看到hello文件,表示构建成功
8.卸载网络共享目录
sudo umount /mnt