鸿 网 互 联 www.68idc.cn

当前位置 : 服务器租用 > 操作系统维护 > vmware > >

使用lvm时的一个问题(FoundduplicatePV)

来源:互联网 作者:佚名 时间:2015-11-14 10:38
网络前沿与资讯,网络风云,网站建设与运营,网赚技巧,软件系统应用,数码科技评测

[root@stmysql2 ~]# pvs
Found duplicate PV ozkHhAfbmyoxllSx4Et5KyZAJDo7net6: using /dev/sdb not /dev/emcpowera
Found duplicate PV ozkHhAfbmyoxllSx4Et5KyZAJDo7net6: using /dev/sdf not /dev/sdb
Found duplicate PV ozkHhAfbmyoxllSx4Et5KyZAJDo7net6: using /dev/sdj not /dev/sdf
Found duplicate PV ozkHhAfbmyoxllSx4Et5KyZAJDo7net6: using /dev/sdn not /dev/sdj
PV VG Fmt Attr PSize PFree
/dev/cciss/c0d0p2 VolGroup00 lvm2 a-- 279.25G 117.19G
/dev/cciss/c0d1p1 datavg lvm2 a-- 1.23T 1.04T
/dev/sdn lvm2 a-- 210.00G 210.00G

原因分析:

默认的扫描设置是扫描所有的磁盘,由于多路径的问题,多块磁盘前面的元数据信息是一致的,导致PV信息相同

With a default configuration, LVM commands will scan for devices in /dev, and check every resulting device for LVM metadata. This is caused by the default filter in /etc/lvm/lvm.conf:

filter = [ "a/.*/" ]

解决方法:
1,修改lvm配置文件,pv扫描时只接受/dev/cciss,/dev/mapper和/dev/emcpower类型的磁盘

filter = [ "a|/dev/cciss/.*|", "a|/dev/mapper/mpath.*|","a|/dev/emcpower.*|","r|.*|" ]

2,运行pvscan和vgscan
[root@stmysql2 ~]# pvscan
PV /dev/cciss/c0d1p1 VG datavg lvm2 [1.23 TB / 1.04 TB free]
PV /dev/cciss/c0d0p2 VG VolGroup00 lvm2 [279.25 GB / 117.19 GB free]
PV /dev/emcpowera lvm2 [210.00 GB]
Total: 3 [1.71 TB] / in use: 2 [1.50 TB] / in no VG: 1 [210.00 GB]
[root@stmysql2 ~]# vgscan
Reading all physical volumes. This may take a while...
Found volume group "datavg" using metadata type lvm2
Found volume group "VolGroup00" using metadata type lvm2
3,运行mkinitrd命令
Once the desired filter is configured, it is recommended to rebuild the initrd with mkinitrd (RHEL4 and 5) or dracut (RHEL 6) so that only the necessary devices are scanned upon reboot.

网友评论
<