磁盘挂载
挂载服务提供方(挂载文件夹)
安装nfs服务:
sudo apt-get install nfs-kernel-server nfs-common portmap
vi /etc/exports 编辑配置文件最后一行添加允许挂载的目标机器:
/mnt/shared 192.168.100.61/255.255.255.0(rw,no_root_squash,sync)
/mnt/shared 192.168.100.60/255.255.255.0(rw,no_root_squash,sync)
/mnt/shared 192.168.100.59/255.255.255.0(rw,no_root_squash,sync)
重启nfs服务
sudo /etc/init.d/nfs-kernel-server restart
挂载服务接受者
安装nfs服务:
sudo apt-get install nfs-kernel-server nfs-common portmap
重启nfs服务
sudo /etc/init.d/nfs-kernel-server restart
挂载目标机器文件夹:
sudo mount -t nfs 192.168.100.62:/mnt/shared /opt/CXNT_WEB/shared
vi /etc/fstab编辑配置文件最后一行添加开机自动挂载:
192.168.100.62:/mnt/shared /opt/CXNT_WEB/shared nfs intr,hard,auto 0 0
异常情况
先将nfs服务stop: sudo /etc/init.d/nfs-kernel-server stop ,在删除 /etc/mtab 里面的有关这次mount的一行, 再sudo umount –f /opt/CXNT_WEB/shared, 在重复上面的mount步骤