Found duplicate PV

RaidoR

New Member
Aug 14, 2015
20
0
1
Hello,

I have a problem with one of VM-s. Backup failed and the log was:
ERROR: Backup of VM 110 failed - can't activate LV '/dev/vgsql/vm-101-disk-1': One or
more specified logical volume(s) not found.

PVS shows:

# pvs
Found duplicate PV gBK2I9xqz88SJW9wDwU9jSsjiZt2xJpd: using /dev/vgsql/vm-101-disk-1 not /dev/vgsql2/vm-210-disk-1
PV VG Fmt Attr PSize PFree
/dev/mapper/mpathb vgvms lvm2 a-- 200.00g 8.99g
/dev/mapper/mpathc vgsql lvm2 a-- 500.00g 500.00g
/dev/mapper/mpathd vgvms2 lvm2 a-- 200.00g 1012.00m
/dev/mapper/mpathe vgmail lvm2 a-- 200.00g 5.00g
/dev/mapper/mpathf vgdata2 lvm2 a-- 300.00g 2.00g
/dev/mapper/mpathg vgdata lvm2 a-- 500.00g 2.00g
/dev/mapper/mpathh vgvms3 lvm2 a-- 193.00g 27.00g
/dev/mapper/mpathi vgsql2 lvm2 a-- 837.00g 268.99g
/dev/sda2 pve lvm2 a-- 931.01g 210.01g
/dev/vgmail/vm-107-disk-1 mail lvm2 a-- 195.00g 1020.00m
/dev/vgsql/vm-101-disk-1 lvm2 a-- 498.00g 498.00g
/dev/vgvms3/vm-102-disk-2 vgsrv lvm2 a-- 20.00g 0

LVdisplay shows:
# lvdisplay
Found duplicate PV gBK2I9xqz88SJW9wDwU9jSsjiZt2xJpd: using /dev/vgsql/vm-101-disk-1 not /dev/vgsql2/vm-210-disk-1

How to begin solving this?
 
Hi,
you have create an pv directly on the device inside the VM instead on an partition (like /dev/sdb instead /dev/sdb1).
Due this the host see the pv in the lv (vm-101-disk-1).
After that, you have cloned the VM - so the node see both PVs...

To avoid this: use partitions and not whole disks (or use filter inside lvm.conf of host).

Udo
 
Any way to fix this so I don't loose my data?
Other choice (instead of filter):
1. add an new disk (same size (if you have a little bit free space inside the VG)) - look with pvs + vgs
2. create an big partition on the new disk (like /dev/sdc1)
3. make an pv on this partition "pvcreate /dev/sdX1"
4. add the new pv to your VG "vgextend /dev/vgsql /dev/sdX1"
5. control with vgs
6. move all data with "pvmove /dev/sdb" (or how your pv with the data is named) - this can take some hours (depends on data) but the application work without big trouble (but less speed).
7. if the move is done, you can reduce the vg "vgreduce /dev/vgsql /dev/sdb", if ok - remove pv: pvremove /dev/sdb.

If all is right, you can delete the disk sdb, so that your VM has the same amount of disks like before...

Udo
 
The VM that is using VM-101-disk-1 is running Windows Server. Is my data safe for now? What happens, if I reboot the VM?
1.PNG

# pvs
Found duplicate PV gBK2I9xqz88SJW9wDwU9jSsjiZt2xJpd: using /dev/vgsql/vm-101-disk-1 not /dev/vgsql2/vm-210-disk-1
PV VG Fmt Attr PSize PFree
/dev/mapper/mpathb vgvms lvm2 a-- 200.00g 8.99g
/dev/mapper/mpathc vgsql lvm2 a-- 500.00g 500.00g
/dev/mapper/mpathd vgvms2 lvm2 a-- 200.00g 1012.00m
/dev/mapper/mpathe vgmail lvm2 a-- 200.00g 5.00g
/dev/mapper/mpathf vgdata2 lvm2 a-- 300.00g 2.00g
/dev/mapper/mpathg vgdata lvm2 a-- 500.00g 2.00g
/dev/mapper/mpathh vgvms3 lvm2 a-- 193.00g 27.00g
/dev/mapper/mpathi vgsql2 lvm2 a-- 837.00g 268.99g
/dev/sda2 pve lvm2 a-- 931.01g 210.01g
/dev/vgmail/vm-107-disk-1 mail lvm2 a-- 195.00g 1020.00m
/dev/vgsql/vm-101-disk-1 lvm2 a-- 498.00g 498.00g
/dev/vgvms3/vm-102-disk-2 vgsrv lvm2 a-- 20.00g 0

# vgs
Found duplicate PV gBK2I9xqz88SJW9wDwU9jSsjiZt2xJpd: using /dev/vgsql/vm-101-disk-1 not /dev/vgsql2/vm-210-disk-1
VG #PV #LV #SN Attr VSize VFree
mail 1 1 0 wz--n- 195.00g 1020.00m
pve 1 3 0 wz--n- 931.01g 210.01g
vgdata 1 1 0 wz--n- 500.00g 2.00g
vgdata2 1 1 0 wz--n- 300.00g 2.00g
vgmail 1 1 0 wz--n- 200.00g 5.00g
vgsql 1 0 0 wz--n- 500.00g 500.00g
vgsql2 1 2 0 wz--n- 837.00g 268.99g
vgsrv 1 1 0 wz--n- 20.00g 0
vgvms 1 6 0 wz--n- 200.00g 8.99g
vgvms2 1 5 0 wz--n- 200.00g 1012.00m
vgvms3 1 4 0 wz--n- 193.00g 27.00g
 
Last edited:
The VM that is using VM-101-disk-1 is running Windows Server. Is my data safe for now? What happens, if I reboot the VM?
View attachment 4293
Hi,
the VM is save... (issue/message is on the host only)

BUT you mixed vm-disks: disk 110 + disk 101 - this can produce very risky and ugly effects (like remove VM 101 and the vm-101-disk-1 lv is deleted also).
You should rename the LV and adjust your config - and don't forget to adjust the lvm-tags too:
Look with "lvs -o +lv_tags" and (as example)
Code:
lvchange --deltag @pve-vm-101 vgsql/vm-101-disk-1
lvchange --addtag @pve-vm-110 vgsql/vm-101-disk-1

Windows-Server + LVM?!? Not realy - that's looks, that you recycled an linux lvm-disk for windows and windows don't clear the pv-signature...
But you should better know, what you have done.

I'm not sure how happy windows is, if you remove the pv-signature from the host...

Best way is create an new disk for the winhost and move all data inside the VM and if all is running, remove the old "buggy" disk.

Udo
 
I have indeed VM 101 that is running Ubuntu.
But the disks on that VM are on VG named vms: (vms:vm-101-disk-1)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!