1.安装 NFS 服务器
sudo apt-get install nfs-kernel-server
2.新建nfs根目录并配置nfs服务路径
mkdir -p $HOME/workspace/nfsroot
sudo echo "/home/flyu/workspace/nfsroot *(rw,sync,no_root_squash,no_subtree_check)" >> /etc/exports
3.重启 rpcbind 与 nfs 服务
sudo /etc/init.d/rpcbind restart
sudo /etc/init.d/nfs-kernel-server restart
4.测试nfs
sudo mount -t nfs 127.0.0.1:/home/flyu/workspace/nfsroot /mnt
网友评论