student_11 发表于 2013-1-28 21:18:21

两台 linux 机器之间mount

比如我有两台 linux 机器,192.168.1.1192.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
页: [1]
查看完整版本: 两台 linux 机器之间mount