NFS/CIFS/iSCSI exports/shares are not automatically mounted at boot on a RHEL client​

环境

  • Red Hat Enterprise Linux 4
  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 7
  • NFS v3
  • NFS v4
  • Samba filesystem
  • Filesystems on block-devices depending on networking (e.g. iSCSI)

问题

  • NFS share is not mounting correctly at boot time as specified in ​​fstab​​ file.
  • Unable to mount nfs share at boot time on Red Hat Enterprise Linux 5.5.
  • NFS/SMBFS mounts do not mount when the system boots up, however, running the following command after boot works to mount the NFS or SMBFS shares:
    Raw
    # mount -a
    Need to know why NFS mounts didn't mount after reboot.

决议

  1. Netfs(remote-fs.target in RHEL7) is responsible for mounting network filesystems at boot time. Enable netfs(remote-fs.target in RHEL7) and reboot:
    Raw
    RHEL 4, 5, 6 # chkconfig netfs on RHEL 7 # systemctl enable remote-fs.target
  2. If that does not solve the problem, try adding the _netdev mount option in the /etc/fstab to the problematic network filesystem mount entry.
    Raw
    # vi /etc/fstab nfs.example.com:/export /mnt/nfs defaults,_netdev 0 0
  3. Reboot the system and verify the network filesystems are mounted.