CFS 无法自动挂载

最近更新时间: 2023-03-15 17:31:31

通过配置/etc/fstab文件实现自动挂载的方法,依赖于remote-fs.target服务,请检查该服务状态,如果处于关闭状态,需手动启动该服务并设置开机自启动。方法及命令如下:

  1. 查看remote-fs.target服务状态
    systemctl status remote-fs.target
  2. 重新加载systemd程序的配置文件
    systemctl daemon-reload
  3. 启动remote-fs.target服务
    systemctl start remote-fs.target
  4. 设置开机自启动remote-fs.target服务
    systemctl enable remote-fs.target
    另外,对于RedHat Enterprise Linux 5/6镜像,请检查是否将netfs脚本设置为开机启动 :
    chkconfig --list netfs
    netfs 0:off 1:off 2:off 3:on 4:on 5:on 6:off
    如果运行级别 3、4 和 5 中未列出on,请使用以下命令启用它:
    chkconfig netfs on
    除上述配置/etc/fstab文件外,可以配置/etc/rc.local文件实现自动挂载,方法及命令如下:
  5. 查看配置文件权限,并修改为可执行权限
    chmod +x /etc/rc.d/rc.local
  6. 设置开机自启动rc.local服务
    systemctl enable rc-local
  7. 启动rc.local服务
    systemctl start rc-local
  8. 查看rc.local服务状态已开启
    systemctl status rc-local.service
  9. 修改配置文件,添加挂载命令
    拷贝挂载命令,复制到/etc/rc.local配置文件中