[转]为啥_netdev 挂载选项和netfs服务均已启动,远程的文件系统(NFS,SAN)没有自动挂载?

 

https://access.redhat.com/solutions/22993

 SOLUTION 已验证 - 已更新 2016年十月10日18:31 - 

English 

环境

  • Red Hat Enterprise Linux Server 5
  • Red Hat Enterprise Linux Server 6
  • netfs service is started at boot (as per chkconfig --list netfs)
  • _netdev option is specified in fstab

问题

  • SAN and NFS file systems are not being mounted automatically after reboot.
  • Using EMC powerpath as multipathing software and have two LVM volumes on the EMC device. These are not mounting even if they have an entry in /etc/fstab. Can mount manually after machine boots up.
  • Default (no) configuration of netfs
  • _netdev mount option specified.
  • SAN based FS not auto mounting after reboot.

决议

A workaround for these issues is to introduce a delay at the end of the start function in the network init script , Using the NETWORKDELAY global parameter.

For details, refer to Why do some of the network services fail at boot time but work once Red Hat Enterprise Linux system is up?.

Start with a high delay of 60 seconds. If this solves the problem, then progressively lower the value until the lowest value at which all network services continue to start is found (This will take some testing to find the magic number). For some systems a value as low as 10 will do the trick, for others a higher value may be needed.

根源

  • Mostly this kind of issue happens when networking is "advertised" to the system as being fully started, when in fact it has not. This problem stems from the fact that the network card itself takes an unusually long time to initialize. This results in network dependent services trying to start before the network is ready to accommodate them.

  • In some SAN device cases, the SAN is slow to complete discovery and/or a 3rd party kernel module, such as 3rd party multipath support, isn't loaded until late in the boot cycle.

  • In these cases, the _netdev flag is a convenient time delayed checkpoint late in the boot cycle to which mounting impacted devices can be postponed. This gives the SAN and/or 3rd party kernel modules time to complete their device discovery and setup.

诊断步骤

  • Check if the service netfs is set to start in the current runlevel and is running.

    Raw

    # chkconfig --list | grep netfs
    
  • Check if adding _netdev as a mount option in /etc/fstab for the filesystem fixes the problem.

  • Device intialization might be the problem. Adding NETWORKDELAY=60 in /etc/sysconfig/network file would solve this.
  • The _netdev option tells the server to ignore these devices when going through the /etc/fstab at boot time:

  • /etc/rc.d/rc.sysinit:

    Raw

    action $"Mounting local filesystems: " mount -a -n -t nfs4,smbfs,ncpfs,cifs,gfs,gfs2 -O no_netdev 
    
  • Devices with _netdev are mounted later in the boot process by the netfs script:

  • /etc/rc.d/init.d/netfs:

    Raw

    action $"Mounting other filesystems: " mount -a -t nonfs,nfs4,cifs,ncpfs,gfs
    
  • Make sure the configuration has configured netfs to be run at boot time, otherwise _netdev flagged mounts won't be processed.

    Raw

    # chkconfig --list netfs
    netfs               0:off     1:off     2:off     3:off     4:off     5:off     6:off
    
  • If not configured to run, change this via the following command:

    Raw

    # chkconfig netfs on

你可能感兴趣的:(RHEL5,RHEL6)