LVM扩容出现”Cannot use device with duplicates”的解决方案

在尝试扩展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

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
保哥的头像保哥
上一篇 2024年7月17日 14:44
下一篇 2024年7月19日 07:26

相关推荐

发表回复

登录后才能评论
近期VMware公司在广泛地发律师函。本站也并非专门提供ISO镜像下载服务的站点,经慎重考虑,决定停止向各位赞助者提供该镜像的下载服务。由此带来的不便,我们深表歉意。