解决方案
使用 lvm.conf 的备份并在 /etc/lvm/lvm.conf 中注释“#”行“volume_list”。
# less /etc/lvm/lvm.conf | grep -i "volume_list" ... # volume_list = [ "vg1", "vg2/lvol1", "@tag1", "@*" ] ...
或者将卷组添加到 volume_list。
# less /etc/lvm/lvm.conf|grep -i "volume_list" volume_list = [ "vg1", "vg2/lvol1", "@tag1", "@*", "Volume Group Name" ]
尝试运行“lvcreate”命令:
# lvcreate -L 4G test_vg Logical volume "lvol0" created.
问题
在尝试创建逻辑卷时,即使卷组处于活动状态,lvcreate 也会失败并显示错误“Volume "test_vg/lvol0" Is Not Active Locally”,并显示如下错误输出:
# lvcreate -L 4G test_vg Volume "test_vg/lvol0" is not active locally. Aborting. Failed to wipe start of new LV.
欢迎 on
it
road
根本原因
“volume_list”在 lvm.conf 文件中被注释掉,并且“volume group”没有添加到 volume_list 中。
物理卷和卷组已成功创建:
# pvcreate /dev/sdc1 Physical volume "/dev/sdc1" successfully created
# vgcreate test_vg /dev/sdc1 Volume group "test_vg" successfully created
'volume_list' 被修改并且没有添加卷组:
# cat /etc/lvm/lvm.conf| grep -i "volume_list" ... # volume_list = [ "vg1", "vg2/lvol1", "@tag1", "@*" ] volume_list = [ "vg1", "vg2/lvol1", "@tag1", "@*" ] ...
PV和VG可见:
# vgdisplay |grep -i "test_vg" VG Name test_vg
# pvs PV VG Fmt Attr PSize PFree /dev/sda2 vg_6 lvm2 a--u 29.51g 0 /dev/sdb1 testvg lvm2 a--u 9.99g 7.99g /dev/sdc1 test_vg lvm2 a--u 4.99g 4.99g
创建逻辑卷和手动激活 VG 后出错:
# lvcreate -L 4G test_vg Volume "test_vg/lvol0" is not active locally. Aborting. Failed to wipe start of new LV.
# vgchange -ay test_vg 0 logical volume(s) in volume group "test_vg" now active
# lvcreate -L 4G test_vg Volume "test_vg/lvol0" is not active locally. Aborting. Failed to wipe start of new LV.
日期:2020-09-17 00:14:03 来源:oir作者:oir