安装依赖

#server apt install nfs-kernel-server -y #client apt install nfs-common -y
Code language: CSS (css)

修改配置文件

root@aml:~# cat /etc/exports # /etc/exports: the access control list for filesystems which may be exported # to NFS clients. See exports(5). # # Example for NFSv2 and NFSv3: # /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check) # # Example for NFSv4: # /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check) # /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check) # /media/H1 192.168.31.*(rw,sync,no_subtree_check)
Code language: PHP (php)

重启服务

systemctl restart nfs-server

客户端NFS存活检测

showmount -e 192.168.31.1
Code language: CSS (css)

客户端挂载

mount 192.168.31.130:/media/H1 H2
Code language: JavaScript (javascript)

FSTAB自动挂载

192.168.31.130:/media/H1 /media/H2 nfs defaults 0 0
Code language: JavaScript (javascript)

结束

分类: Linux

0 条评论

发表评论

Avatar placeholder

您的电子邮箱地址不会被公开。

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据