CentOS7 正确挂载网络磁盘方法 |
您所在的位置:网站首页 › centos7开机自动挂载硬盘 › CentOS7 正确挂载网络磁盘方法 |
服务端 1. 安装nfs-nfs-utils, rpcbind yum install nfs-utils rpcbind2. 设置rpcbind和nfs服务开机自动启动 systemctl enable nfs.service systemctl enable rpcbind.service3. 启动rpcbind和nfs服务,顺序不要弄反,反了会出现类似program not registered的错误 /bin/systemctl start rpcbind.service /bin/systemctl start nfs.service4. 创建共享目录 mkdir /data/share5. 编辑共享设置文件/etc/exports vi /etc/exports文件后面添加如下内容: /data/share 192.168.1.24(rw,no_root_squash,no_subtree_check)说明:192.168.1.24`是客户端地址 6. 让配置文件生效 exportfs -a7. 查看是否共享成功 showmount -e会显示类似下面的效果: Export list for InnerHost: /data/share/ 192.168.1.24客户端 1. 安装nfs-utils, rpcbind yum install nfs-utils rpcbind2. 设置rpcbind和nfs服务开机自动启动 systemctl enable nfs.service systemctl enable rpcbind.service3. 启动rpcbind和nfs服务,顺序不要弄反 /bin/systemctl start rpcbind.service /bin/systemctl start nfs.service4. 查看是否可以探测到服务器的共享 showmount -e 192.168.1.24说明:192.168.1.24是服务器的IP地址 5. 创建映射目录 mkdir /data/link-share6. 编辑挂载配置文件/etc/fstab vi /etc/fstab在文件后面添加下面的内容: 192.168.1.24:/data/share /data/link-share nfs rw,tcp,intr 0 1说明:192.168.1.24是服务器的IP地址 7. 挂载 mount -t nfs 192.168.1.24:/data/share /data/link-share(资源库 www.zyku.net) |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |