我有 3node 集群(centos7),在安装 glusterfs 和 heketi 时,我发现 LV 中存在重复 pv 的问题。
[centos@master-node ~]$ sudo pvs
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: Not using device /dev/loop1 for PV tJno1Q-hyH5-BtA5-j04f-XOui-wMUS-7Rn4V7.
WARNING: Not using device /dev/loop2 for PV tJno1Q-hyH5-BtA5-j04f-XOui-wMUS-7Rn4V7.
WARNING: Not using device /dev/loop9 for PV tJno1Q-hyH5-BtA5-j04f-XOui-wMUS-7Rn4V7.
WARNING: PV tJno1Q-hyH5-BtA5-j04f-XOui-wMUS-7Rn4V7 prefers device /dev/loop0 because device is used by LV.
WARNING: PV tJno1Q-hyH5-BtA5-j04f-XOui-wMUS-7Rn4V7 prefers device /dev/loop0 because device is used by LV.
WARNING: PV tJno1Q-hyH5-BtA5-j04f-XOui-wMUS-7Rn4V7 prefers device /dev/loop0 because device is used by LV.
PV VG Fmt Attr PSize PFree
/dev/loop0 recover1 lvm2 a-- 239.87g <237.85g
/dev/sda2 centos lvm2 a-- 390.00g 0
/dev/sdb centos lvm2 a-- <100.00g 1.00g
[centos@master-node ~]$ sudo lvs
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: Not using device /dev/loop1 for PV GgwJoD-TzcN-LFts-CohB-LRIY-K2tl-qD0nXF.
WARNING: Not using device /dev/loop2 for PV GgwJoD-TzcN-LFts-CohB-LRIY-K2tl-qD0nXF.
WARNING: Not using device /dev/loop9 for PV GgwJoD-TzcN-LFts-CohB-LRIY-K2tl-qD0nXF.
WARNING: PV GgwJoD-TzcN-LFts-CohB-LRIY-K2tl-qD0nXF prefers device /dev/loop0 because device is used by LV.
WARNING: PV GgwJoD-TzcN-LFts-CohB-LRIY-K2tl-qD0nXF prefers device /dev/loop0 because device is used by LV.
WARNING: PV GgwJoD-TzcN-LFts-CohB-LRIY-K2tl-qD0nXF prefers device /dev/loop0 because device is used by LV.
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
home centos -wi-ao---- 90.00g
root centos -wi-ao---- 399.00g
brick_3108b8903c1ef1cfd8a2aacddb02b30d recover Vwi---tz-- 2.00g tp_3108b8903c1ef1cfd8a2aacddb02b30d
tp_3108b8903c1ef1cfd8a2aacddb02b30d recover twi---tz-- 2.00g
[centos@master-node ~]$ sudo vgdisplay
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: Not using device /dev/loop1 for PV GgwJoD-TzcN-LFts-CohB-LRIY-K2tl-qD0nXF.
WARNING: Not using device /dev/loop2 for PV GgwJoD-TzcN-LFts-CohB-LRIY-K2tl-qD0nXF.
WARNING: Not using device /dev/loop9 for PV GgwJoD-TzcN-LFts-CohB-LRIY-K2tl-qD0nXF.
WARNING: PV GgwJoD-TzcN-LFts-CohB-LRIY-K2tl-qD0nXF prefers device /dev/loop0 because device is used by LV.
WARNING: PV GgwJoD-TzcN-LFts-CohB-LRIY-K2tl-qD0nXF prefers device /dev/loop0 because device is used by LV.
WARNING: PV GgwJoD-TzcN-LFts-CohB-LRIY-K2tl-qD0nXF prefers device /dev/loop0 because device is used by LV.
--- Volume group ---
VG Name centos
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 5
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 2
Act PV 2
VG Size 490.00 GiB
PE Size 4.00 MiB
Total PE 125440
Alloc PE / Size 125184 / 489.00 GiB
Free PE / Size 256 / 1.00 GiB
VG UUID 2rXrFU-zzc5-semj-qfep-TwKw-wEGq-S46pFR
--- Volume group ---
VG Name recover
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 9
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 239.87 GiB
PE Size 4.00 MiB
Total PE 61407
Alloc PE / Size 518 / 2.02 GiB
Free PE / Size 60889 / <237.85 GiB
VG UUID VmxXUO-IDmA-OxHZ-K3v3-rFe7-Hc0Z-KcZbH0
我尝试运行以下命令来修复它,但看起来它不起作用......警告:无法扫描设备。 https://sontsysadmin.blogspot.com/2017/09/mounting-lvm-with-same-pv-lv-vg-names.html?_sm_au_=i5V21DP5FTWnq7jRML8tvK34L00HF
[centos@master-node ~]$ sudo vgimportclone --basevgname recover /dev/loop1
WARNING: Not using device /dev/loop1 for PV GgwJoD-TzcN-LFts-CohB-LRIY-K2tl-qD0nXF.
WARNING: Not using device /dev/loop2 for PV GgwJoD-TzcN-LFts-CohB-LRIY-K2tl-qD0nXF.
WARNING: Not using device /dev/loop9 for PV GgwJoD-TzcN-LFts-CohB-LRIY-K2tl-qD0nXF.
WARNING: PV GgwJoD-TzcN-LFts-CohB-LRIY-K2tl-qD0nXF prefers device /dev/loop0 because device is used by LV.
WARNING: PV GgwJoD-TzcN-LFts-CohB-LRIY-K2tl-qD0nXF prefers device /dev/loop0 because device is used by LV.
WARNING: PV GgwJoD-TzcN-LFts-CohB-LRIY-K2tl-qD0nXF prefers device /dev/loop0 because device is used by LV.
WARNING: found device with duplicate /dev/loop0
WARNING: found device with duplicate /dev/loop2
WARNING: found device with duplicate /dev/loop9
WARNING: Disabling lvmetad cache which does not support duplicate PVs.
WARNING: Scan found duplicate PVs.
WARNING: Failed to scan devices.
WARNING: Update lvmetad with pvscan --cache.
我对 Linux 管理,特别是 lvm 还很陌生。请帮助修复此问题。任何提示都会有帮助。