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

68 篇文章 0 订阅

 

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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值