在尝试扩展VG时,产生了以下错误信息:
[root@shizhanxia.com ~]# vgextend example_vg /dev/mapper/mpatha Error vgextend : Cannot use device /dev/mapper/mpatha with duplicates. WARNING: Not using lvmetad because duplicate PVs were found. WARNING: Use multipath or vgimportclone to resolve duplicate PVs? WARNING: After duplicates are resolved, run "pvscan --cache" to enable lvmetad. WARNING: PV xxxxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxxx on /dev/sdx was already found on /dev/sdy. WARNING: PV xxxxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxxx on /dev/sdy was already found on /dev/sdz. WARNING: PV xxxxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxxx on /dev/sdz was already found on /dev/mapper/mpatha. <...>
查看/etc/lvm/lvm.conf的过滤规则,如下所示:
# Example # Accept every block device: #filter = [ "a|.*/|" ] # Reject the cdrom drive: # filter = [ "r|/dev/cdrom|" ] # Work with just loopback devices, e.g. for testing: # filter = [ "a|loop|", "r|.*|" ] # Accept all loop devices and ide drives except hdc: # filter = [ "a|loop|", "r|/dev/hdc|", "a|/dev/ide|", "r|.*|" ] # Use anchors to be very specific: # filter = [ "a|^/dev/hda8$|", "r|.*/|" ] # # This configuration option has an automatic default value. # filter = [ "a|.*/|" ] # Configuration option devices/global_filter. # Limit the block devices that are used by LVM system components. # Because devices/filter may be overridden from the command line, it is # not suitable for system-wide device filtering, e.g. udev and lvmetad. # Use global_filter to hide devices from these LVM system components. # The syntax is the same as devices/filter. Devices rejected by # global_filter are not opened by LVM. # This configuration option has an automatic default value. # global_filter = [ "a|.*/|" ]
如果没有适当的过滤规则,那么lvm.conf文件将默认接受所有设备:
# This configuration option has an automatic default value. # filter = [ "a|.*/|" ]
解决方案
解决该问题需要设置自定义过滤规则/etc/lvm/lvm.conf,包括全局过滤规则。
一、设置过滤规则
原创文章,作者:保哥,如若转载,请注明出处:https://www.shizhanxia.com/1318.html