比如我有两台 linux 机器,192.168.1.1 192.168.1.2
现在我要将 192.168.1.1 下的/opt/mydir 目录挂在到 192.168.1.2 /opt/mydir1 目录下。
需要以下操作:
1.服务器端 192.168.1.1
在/etc/exports 目下添加共享目录
/opt/mydir 192.168.1.2(rw)
/opt/mydir hostname(rw)
hostname 是指192.168.1.2 的hostname, 需要在/etc/hosts 中添加 hosts
2.启动192.168.1.1 的nfs 服务
/etc/rc.d/init.d/portmap start (在REDHAT中PORTMAP是默认启动的)
/etc/rc.d/init.d/nfs start 启动NFS服务
/etc/rc.d/init.d/nfs stop 停止NFS服务
3.在192.168.1.2 上mount 目录
#mount -t nfs -o rw 192.168.1.1:/opt/mydir /opt/mydir1
现在我要将 192.168.1.1 下的/opt/mydir 目录挂在到 192.168.1.2 /opt/mydir1 目录下。
需要以下操作:
1.服务器端 192.168.1.1
在/etc/exports 目下添加共享目录
/opt/mydir 192.168.1.2(rw)
/opt/mydir hostname(rw)
hostname 是指192.168.1.2 的hostname, 需要在/etc/hosts 中添加 hosts
2.启动192.168.1.1 的nfs 服务
/etc/rc.d/init.d/portmap start (在REDHAT中PORTMAP是默认启动的)
/etc/rc.d/init.d/nfs start 启动NFS服务
/etc/rc.d/init.d/nfs stop 停止NFS服务
3.在192.168.1.2 上mount 目录
#mount -t nfs -o rw 192.168.1.1:/opt/mydir /opt/mydir1
Linux服务器间NFS共享挂载教程
本文详细介绍了如何在两台Linux服务器之间通过NFS实现目录共享挂载。首先在192.168.1.1服务器上编辑/etc/exports,添加共享目录并指定权限,然后启动NFS服务。接着,在192.168.1.2服务器上使用mount命令挂载192.168.1.1的共享目录。
1015

被折叠的 条评论
为什么被折叠?



