如何将一个linux服务器挂载到另外一个linux服务器上

现在有两台服务器,ip分别为:192.168.0.10、192.168.0.11
需要将192.168.0.10的/home/rims/test/Attachment/以及/home/rims/version/Attachment/ 挂载到
192.168.0.11的 /app/attachment上

共享目录

开启NFS服务

chkconfig --level 35 nfs on
service nfs start

在192.168.0.10的服务器端中编辑/etc/exports文件,添加如下内容:

/home/rims/test/Attachment/ 192.168.0.11(rw,no_root_squash,no_all_squash,sync)
/home/rims/version/Attachment/ 192.168.0.11(rw,no_root_squash,no_all_squash,sync)

service nfs restart

service rpcbind restart

source /etc/exports

在要挂载的服务器执行命令

查看挂载目录的情况

df -i

如果原有的不用了,卸载原有的

umount /app/attachment

在192.168.0.11执行

mount -t nfs 172.20.0.170:/home/rims/test/Attachment  /app/attachment

df -i 检查挂载成功!

posted on 2022-04-25 15:08  韩山隐士  阅读(760)  评论(0编辑  收藏  举报