Storage fails to activate or mount automatically during boot?

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

 SOLUTION 已验证 - 已更新 2014年十月23日14:14 - 

English 

环境

  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6

问题

  • Storage fails to activate or mount automatically during boot

Raw

# lvs -o +devices
  LV          VG                 Attr   LSize   Devices                       
  lv_one      vg_one    -wi-ao  20.00G /dev/mpath/mpath1(0)    
  lv_two      vg_two    -wi-ao 385.00G /dev/mpath/mpath2(0)   
  lv_three    vg_three  -wi-ao 250.00G /dev/mpath/mpath3(0)
  lv_four     vg_four   -wi--- 250.00G /dev/mpath/mpath4(0)    
  lv_five     vg_five   -wi---  20.00G /dev/mpath/mpath5(0)

Raw

# grep vg_one /etc/fstab
/dev/vg_one/lv_one    /data    ext3    defaults    0 0
# mount | grep vg_one -c
0

决议

1) Add the _netdev option to the fstab options column for this device

Raw

/dev/vg_one/lv_one    /data    ext3    defaults,_netdev    0 0

2) Enable the netfs service

Raw

# chkconfig netfs on
  • In additional, some application or database use lv directly (raw device), it means this device's vg doesn't have file system, in this situation, the method above still work. For example:

Raw

/dev/vg_test/lv_test    /data    ext4    defaults,_netdev    0 0

lv "/dev/vg_test/lv_test" do not need to be existed, it mean you do not need to create file system or create lv purposely. Only make sure vg name is correct, after os boot, vg "vg_test" will be activated. But it will have file system mount failed message during os boot:

Raw

Setting up Logical Volume Management: 1 logical volume(s) in volume group "vg_test" now active      [OK]
Checking network-attached filesystems
Mounting filesystems:  mount: special device /dev/vg_test/lv_test does not exist      [FAILED]

根源

  • The storage needs more time to become ready on the host
  • For iSCSI storage, the operation of activating vg defined in script file "/etc/rc.sysinit" was done before network service starting.
  • While the _netdev mount option was created for network connected devices, it can be used to introduce a delay before running another activation and mount
  • The _netdev options calls the /etc/init.d/netfs script, which by default starts after networking.
  • The netfs script calls another vgchange and mount for this device, allowing activation and mounting
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值