安装NFS服务器
- 安装Ubuntu nfs服务器端
- sudo apt-get install nfs-kernel-server
- 安装nfs的客户端
- sudo apt-get install nfs-common
修改配置文件/etc/exports
- sudo vim /etc/exports
- 在最后一行添加
/home/jason/face *(insecure,rw,sync,no_root_squash,no_subtree_check)
- 这里要注意一定要加入insecure,不然会报错:
mount.nfs: access denied by server while mounting 10.120.3.64:/home/jason/fa
- 重启nfs服务
- sudo service restartnfs-kernel-server restart
挂载指令
- sudo mount -t nfs ***.***.***.***:/home/jason/face /mnt -o nolock
***.***.***.***是NFS服务器的IP地址
参考的博客:Ubuntu安装配置NFS