- 安装nfs-kernel-server
apt install nfs-kernel-server
- 想好自己要把哪个目录作为NFS共享目录,创建目录
mkdir /mydata
- vim /etc/exports 添加我们自己想要共享的目录
/mydata 192.168.188.0/24(rw,sync,insecure,no_subtree_check,no_root_squash)
- 重载数据
exportfs -rv
- 启动
#启动rpc
systemctl start rpcbind
#设置开机启动
systemctl enable rpcbind
#启动 NFS 服务
systemctl start nfs-kernel-server
systemctl enable nfs-kernel-server
- 客户端挂载
#安装nfs
apt install nfs-kernel-server
#挂载到自己想挂载的目录
mount -t nfs 192.168.188.152:/mydata /lijq-test
标签:kernel,server,systemctl,NFS,nfs,Ubuntu20,安装,目录
From: https://www.cnblogs.com/hi-lijq/p/17824808.html