PV#s are not unique
Hi,
I have the following problem:
I tried to pvmove PEs off of a PV and to remove that PV using vgreduce. Unfortunatly it looks as if it did not really work. Now vgscan does not find my VG vg_stuff any more.
I assume this might be the reason:
| marvin:~# pvdisplay /dev/ide/host?/bus?/target?/lun0/part1 | grep '^PV#' | pvdisplay -- no physical volume identifier on "/dev/ide/host0/bus0/target0/lun0/part1" | | PV# 3 | PV# 6 | PV# 6 | PV# 4 | PV# 2 | PV# 1 | PV# 3
[PV#s are not unique]
All 7 PVs belond to the same volume group (VG Name: vg_stuff). Now when I run vgscan, it does not detect this volumegroup. pvscan shows the PVs as associated to an unknown VG.
Any idea on how to recover from this? I'm using Logical Volume Manager Tools Version 1.0.1-rc4 and kernel version 2.4.12-xfs-lvm1.0.1rc4.
Thanks in Advance,
yours,
peter
Signature · 4 lines
PGP signed and encrypted | .''`. ** Debian GNU/Linux **
messages preferred. | : :' : The universal
| `. `' Operating System.
http://www.palfrader.org/ | `- http://www.debian.org/pvscan -- reading all physical volumes (this may take a while...)
pvscan -- ACTIVE PV "/dev/scsi/host0/bus0/target3/lun0/part2" of VG "vg_system" [8.25 GB / 512.00 MB free]
pvscan -- inactive PV "/dev/ide/host2/bus1/target0/lun0/part1" is associated to an unknown VG (run vgscan) pvscan -- inactive PV "/dev/ide/host2/bus1/target1/lun0/part1" is associated to an unknown VG (run vgscan) pvscan -- inactive PV "/dev/ide/host2/bus0/target0/lun0/part1" is associated to an unknown VG (run vgscan) pvscan -- inactive PV "/dev/ide/host2/bus0/target1/lun0/part1" is associated to an unknown VG (run vgscan) pvscan -- inactive PV "/dev/ide/host0/bus1/target0/lun0/part1" is associated to an unknown VG (run vgscan) pvscan -- inactive PV "/dev/ide/host0/bus1/target1/lun0/part1" is associated to an unknown VG (run vgscan) pvscan -- inactive PV "/dev/ide/host0/bus0/target1/lun0/part1" is associated to an unknown VG (run vgscan)
pvscan -- total: 8 [428.54 GB] / in use: 8 [428.54 GB] / in no VG: 0 [0]
vgscan -- removing "/etc/lvmtab" and "/etc/lvmtab.d"
vgscan -- creating empty "/etc/lvmtab" and "/etc/lvmtab.d"
vgscan -- reading all physical volumes (this may take a while...)
vgscan -- scanning for all active volume group(s) first
vgscan -- found active volume group "vg_system"
vgscan -- reading data of volume group "vg_system" from physical volume(s)
vgscan -- inserting "vg_system" into lvmtab
vgscan -- backing up volume group "vg_system"
vgscan -- checking volume group name "vg_system"
vgscan -- checking volume group consistency of "vg_system"
vgscan -- checking existence of "/etc/lvmtab.d"
vgscan -- storing volume group data of "vg_system" in "/etc/lvmtab.d/vg_system.tmp" vgscan -- storing physical volume data of "vg_system" in "/etc/lvmtab.d/vg_system.tmp" vgscan -- storing logical volume data of volume group "vg_system" in "/etc/lvmtab.d/vg_system.tmp" vgscan -- renaming "/etc/lvmtab.d/vg_system.tmp" to "/etc/lvmtab.d/vg_system" vgscan -- removing special files and directory for volume group "vg_system"
vgscan -- creating directory and group character special file for "vg_system" vgscan -- creating block device special files for vg_system
vgscan -- "/etc/lvmtab" and "/etc/lvmtab.d" successfully created
vgscan -- WARNING: This program does not do a VGDA backup of your volume group
--- Physical volume ---
PV Name /dev/ide/host0/bus0/target1/lun0/part1 VG Name vg_stuff PV Size 38.35 GB / NOT usable 2.69 MB [LVM: 125.00 KB] PV# 3 PV Status available Allocatable yes Cur LV 1 PE Size (KByte) 32768 Total PE 1227 Free PE 1159 Allocated PE 68 PV UUID d2skhN-h8w6-BzUz-joKn-Wad5-oN22-bw5O7i
--- Physical volume ---
PV Name /dev/ide/host0/bus1/target0/lun0/part1 VG Name vg_stuff PV Size 57.27 GB / NOT usable 52.14 MB [LVM: 131.00 KB] PV# 6 PV Status available Allocatable yes Cur LV 1 PE Size (KByte) 32768 Total PE 1831 Free PE 660 Allocated PE 1171 PV UUID Et6EvH-2q6q-sgf1-4WgR-emQF-n4nw-o0Dx1j
--- Physical volume ---
PV Name /dev/ide/host0/bus1/target1/lun0/part1 VG Name vg_stuff PV Size 57.27 GB / NOT usable 52.14 MB [LVM: 131.00 KB] PV# 6 PV Status available Allocatable yes Cur LV 0 PE Size (KByte) 32768 Total PE 1831 Free PE 1831 Allocated PE 0 PV UUID fL3U3f-yFiv-4mxi-pDId-v02W-wzZL-YDCElL
--- Physical volume ---
PV Name /dev/ide/host2/bus0/target0/lun0/part1 VG Name vg_stuff PV Size 76.34 GB / NOT usable 55.22 MB [LVM: 133.00 KB] PV# 4 PV Status available Allocatable yes (but full) Cur LV 1 PE Size (KByte) 32768 Total PE 2441 Free PE 0 Allocated PE 2441 PV UUID sP1cxE-MPdJ-zAQt-jGjs-RObn-I1KF-n2MEL2
--- Physical volume ---
PV Name /dev/ide/host2/bus0/target1/lun0/part1 VG Name vg_stuff PV Size 38.34 GB / NOT usable 28.38 MB [LVM: 125.00 KB] PV# 2 PV Status available Allocatable yes Cur LV 0 PE Size (KByte) 32768 Total PE 1226 Free PE 1226 Allocated PE 0 PV UUID VEx44c-TcOv-GHsR-gNip-7mWv-zU1w-UDE0w9
--- Physical volume ---
PV Name /dev/ide/host2/bus1/target0/lun0/part1 VG Name vg_stuff PV Size 76.34 GB / NOT usable 23.22 MB [LVM: 130.00 KB] PV# 1 PV Status available Allocatable yes (but full) Cur LV 1 PE Size (KByte) 32768 Total PE 2442 Free PE 0 Allocated PE 2442 PV UUID EGp6Xa-CJia-693v-C1nh-t4aO-Pat8-CUJNe3
--- Physical volume ---
PV Name /dev/ide/host2/bus1/target1/lun0/part1 VG Name vg_stuff PV Size 76.34 GB / NOT usable 55.22 MB [LVM: 133.00 KB] PV# 3 PV Status available Allocatable yes (but full) Cur LV 1 PE Size (KByte) 32768 Total PE 2441 Free PE 0 Allocated PE 2441 PV UUID fpFhZ5-TyYJ-FW5P-HLcV-UIdz-jYQe-62DJea
Peter,
have never seen this one before ;-)
But anyway:
you need to read te first sector of
/dev/ide/host0/bus1/target1/lun0/part1
and
/dev/ide/host0/bus0/target1/lun0/part1.
Change unsigned int value (4 byte) at decimal offset 432 to 5 for bus1 and to 7 for bus0 which should give you unique numbering of PVs and store them back to the corresponding disks.
You can achieve that for eg. with:
perl -e '$n=5;($h,$d,$t)=unpack("a432Va76",<>);print pack ("a432Va76",$h,$n,$t);' /dev/ide/host0/bus1/target1/lun0/part1 > b1.tmp; dd is=b1.tmp of=/dev/ide/host0/bus1/target1/lun0/part1 bs=512; rm b1.tmp
perl -e '$n=7;($h,$d,$t)=unpack("a432Va76",<>);print pack ("a432Va76",$h,$n,$t);' /dev/ide/host0/bus0/target1/lun0/part1 > b0.tmp; dd is=b0.tmp of=/dev/ide/host0/bus0/target1/lun0/part1 bs=512; rm b0.tmp
Try vgscan again.
Regards,
Heinz -- The LVM Guy --
Quoted 28 lines · Peter Palfrader
Hi,
I have the following problem:
I tried to pvmove PEs off of a PV and to remove that PV using vgreduce. Unfortunatly it looks as if it did not really work. Now vgscan does not find my VG
vg_stuffany more.I assume this might be the reason:
| marvin:~# pvdisplay /dev/ide/host?/bus?/target?/lun0/part1 | grep '^PV#' | pvdisplay -- no physical volume identifier on "/dev/ide/host0/bus0/target0/lun0/part1" | | PV# 3 | PV# 6 | PV# 6 | PV# 4 | PV# 2 | PV# 1 | PV# 3[PV#s are not unique]
All 7 PVs belond to the same volume group (VG Name:
vg_stuff). Now when I run vgscan, it does not detect this volumegroup. pvscan shows the PVs as associated to an unknown VG.
Quoted 146 lines
Any idea on how to recover from this? I'm using Logical Volume Manager Tools Version 1.0.1-rc4 and kernel version 2.4.12-xfs-lvm1.0.1rc4.
Thanks in Advance,
yours,
peterSignature · 136 lines
PGP signed and encrypted | .''`. ** Debian GNU/Linux ** messages preferred. | : :' : The universal | `. `' Operating System. http://www.palfrader.org/ | `- http://www.debian.org/ pvscan -- reading all physical volumes (this may take a while...) pvscan -- ACTIVE PV "/dev/scsi/host0/bus0/target3/lun0/part2" of VG "vg_system" [8.25 GB / 512.00 MB free] pvscan -- inactive PV "/dev/ide/host2/bus1/target0/lun0/part1" is associated to an unknown VG (run vgscan) pvscan -- inactive PV "/dev/ide/host2/bus1/target1/lun0/part1" is associated to an unknown VG (run vgscan) pvscan -- inactive PV "/dev/ide/host2/bus0/target0/lun0/part1" is associated to an unknown VG (run vgscan) pvscan -- inactive PV "/dev/ide/host2/bus0/target1/lun0/part1" is associated to an unknown VG (run vgscan) pvscan -- inactive PV "/dev/ide/host0/bus1/target0/lun0/part1" is associated to an unknown VG (run vgscan) pvscan -- inactive PV "/dev/ide/host0/bus1/target1/lun0/part1" is associated to an unknown VG (run vgscan) pvscan -- inactive PV "/dev/ide/host0/bus0/target1/lun0/part1" is associated to an unknown VG (run vgscan) pvscan -- total: 8 [428.54 GB] / in use: 8 [428.54 GB] / in no VG: 0 [0] vgscan -- removing "/etc/lvmtab" and "/etc/lvmtab.d" vgscan -- creating empty "/etc/lvmtab" and "/etc/lvmtab.d" vgscan -- reading all physical volumes (this may take a while...) vgscan -- scanning for all active volume group(s) first vgscan -- found active volume group "vg_system" vgscan -- reading data of volume group "vg_system" from physical volume(s) vgscan -- inserting "vg_system" into lvmtab vgscan -- backing up volume group "vg_system" vgscan -- checking volume group name "vg_system" vgscan -- checking volume group consistency of "vg_system" vgscan -- checking existence of "/etc/lvmtab.d" vgscan -- storing volume group data of "vg_system" in "/etc/lvmtab.d/vg_system.tmp" vgscan -- storing physical volume data of "vg_system" in "/etc/lvmtab.d/vg_system.tmp" vgscan -- storing logical volume data of volume group "vg_system" in "/etc/lvmtab.d/vg_system.tmp" vgscan -- renaming "/etc/lvmtab.d/vg_system.tmp" to "/etc/lvmtab.d/vg_system" vgscan -- removing special files and directory for volume group "vg_system" vgscan -- creating directory and group character special file for "vg_system" vgscan -- creating block device special files for vg_system vgscan -- "/etc/lvmtab" and "/etc/lvmtab.d" successfully created vgscan -- WARNING: This program does not do a VGDA backup of your volume group --- Physical volume --- PV Name /dev/ide/host0/bus0/target1/lun0/part1 VG Name vg_stuff PV Size 38.35 GB / NOT usable 2.69 MB [LVM: 125.00 KB] PV# 3 PV Status available Allocatable yes Cur LV 1 PE Size (KByte) 32768 Total PE 1227 Free PE 1159 Allocated PE 68 PV UUID d2skhN-h8w6-BzUz-joKn-Wad5-oN22-bw5O7i --- Physical volume --- PV Name /dev/ide/host0/bus1/target0/lun0/part1 VG Name vg_stuff PV Size 57.27 GB / NOT usable 52.14 MB [LVM: 131.00 KB] PV# 6 PV Status available Allocatable yes Cur LV 1 PE Size (KByte) 32768 Total PE 1831 Free PE 660 Allocated PE 1171 PV UUID Et6EvH-2q6q-sgf1-4WgR-emQF-n4nw-o0Dx1j --- Physical volume --- PV Name /dev/ide/host0/bus1/target1/lun0/part1 VG Name vg_stuff PV Size 57.27 GB / NOT usable 52.14 MB [LVM: 131.00 KB] PV# 6 PV Status available Allocatable yes Cur LV 0 PE Size (KByte) 32768 Total PE 1831 Free PE 1831 Allocated PE 0 PV UUID fL3U3f-yFiv-4mxi-pDId-v02W-wzZL-YDCElL --- Physical volume --- PV Name /dev/ide/host2/bus0/target0/lun0/part1 VG Name vg_stuff PV Size 76.34 GB / NOT usable 55.22 MB [LVM: 133.00 KB] PV# 4 PV Status available Allocatable yes (but full) Cur LV 1 PE Size (KByte) 32768 Total PE 2441 Free PE 0 Allocated PE 2441 PV UUID sP1cxE-MPdJ-zAQt-jGjs-RObn-I1KF-n2MEL2 --- Physical volume --- PV Name /dev/ide/host2/bus0/target1/lun0/part1 VG Name vg_stuff PV Size 38.34 GB / NOT usable 28.38 MB [LVM: 125.00 KB] PV# 2 PV Status available Allocatable yes Cur LV 0 PE Size (KByte) 32768 Total PE 1226 Free PE 1226 Allocated PE 0 PV UUID VEx44c-TcOv-GHsR-gNip-7mWv-zU1w-UDE0w9 --- Physical volume --- PV Name /dev/ide/host2/bus1/target0/lun0/part1 VG Name vg_stuff PV Size 76.34 GB / NOT usable 23.22 MB [LVM: 130.00 KB] PV# 1 PV Status available Allocatable yes (but full) Cur LV 1 PE Size (KByte) 32768 Total PE 2442 Free PE 0 Allocated PE 2442 PV UUID EGp6Xa-CJia-693v-C1nh-t4aO-Pat8-CUJNe3 --- Physical volume --- PV Name /dev/ide/host2/bus1/target1/lun0/part1 VG Name vg_stuff PV Size 76.34 GB / NOT usable 55.22 MB [LVM: 133.00 KB] PV# 3 PV Status available Allocatable yes (but full) Cur LV 1 PE Size (KByte) 32768 Total PE 2441 Free PE 0 Allocated PE 2441 PV UUID fpFhZ5-TyYJ-FW5P-HLcV-UIdz-jYQe-62DJea
*** Software bugs are stupid.
Nevertheless it needs not so stupid people to solve them ***
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Heinz Mauelshagen Sistina Software Inc.
Senior Consultant/Developer Am Sonnenhang 11
56242 Marienrachdorf Germany
[email protected] +49 2626 141200
FAX 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Hi Heinz!
Quoted 11 lines · Heinz J . Mauelshagen
But anyway:
you need to read te first sector of
/dev/ide/host0/bus1/target1/lun0/part1
and/dev/ide/host0/bus0/target1/lun0/part1.Change unsigned int value (4 byte) at decimal offset 432 to 5 for bus1 and to 7 for bus0 which should give you unique numbering of PVs and store them back to the corresponding disks.
Thank you for your reply, I did this. PVids are unique now, but vgscan still does not find and activate the volume group.
Do you have something else I could try?
I think of trying to restore the metadata on all PVs using vgcfgrestore since I have a few copies of vg_stuff.conf in /etc/lvmconf. Would this be a stupid idea?
TIA
yours,
peter
Signature · 4 lines
PGP signed and encrypted | .''`. ** Debian GNU/Linux **
messages preferred. | : :' : The universal
| `. `' Operating System
http://www.palfrader.org/ | `- http://www.debian.org/Quoted 16 lines · Peter Palfrader
Hi Heinz!
Quoted 11 lines · Heinz J . Mauelshagen
But anyway:
you need to read te first sector of
/dev/ide/host0/bus1/target1/lun0/part1
and/dev/ide/host0/bus0/target1/lun0/part1.Change unsigned int value (4 byte) at decimal offset 432 to 5 for bus1 and to 7 for bus0 which should give you unique numbering of PVs and store them back to the corresponding disks.
Quoted 8 lines
Thank you for your reply, I did this. PVids are unique now, but vgscan still does not find and activate the volume group.
Do you have something else I could try?
I think of trying to restore the metadata on all PVs using vgcfgrestore since I have a few copies of vg_stuff.conf in
/etc/lvmconf. Would this be a stupid idea?
No, not at all. This is actually the recommended wayx to restore a messy VG ;-) You need to run "pvcreate -ff" on all of the (former) PVs and vgcfgrestore on each of them afterwards.
Could you save your VG's metadata before by running
for PV in YOurPVs
do dd if=/dev/$PV of=VGDA.${VGName}.$PV bs=1k count=512
done
and storing the copies on tape or something so that we are able to backup for potential further investigation?
Quoted 16 lines
TIA
yours,
peterSignature · 10 lines
PGP signed and encrypted | .''`. ** Debian GNU/Linux ** messages preferred. | : :' : The universal | `. `' Operating System http://www.palfrader.org/ | `- http://www.debian.org/ _______________________________________________ linux-lvm mailing list [email protected] http://lists.sistina.com/mailman/listinfo/linux-lvm read the LVM HOW-TO at http://www.sistina.com/lvm/Pages/howto.html
Signature · 15 lines
Regards,
Heinz -- The LVM Guy --
*** Software bugs are stupid.
Nevertheless it needs not so stupid people to solve them ***
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Heinz Mauelshagen Sistina Software Inc.
Senior Consultant/Developer Am Sonnenhang 11
56242 Marienrachdorf
Germany
[email protected] +49 2626 141200
FAX 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-Hello,
Quoted 7 lines · Heinz J . Mauelshagen
Quoted 3 lines
I think of trying to restore the metadata on all PVs using vgcfgrestore since I have a few copies of vg_stuff.conf in
/etc/lvmconf. Would this be a stupid idea?No, not at all. This is actually the recommended wayx to restore a messy VG ;-) You need to run "pvcreate -ff" on all of the (former) PVs and vgcfgrestore on each of them afterwards.
Done that. Didn't help.
for PV in PVs.... pvscreate -ff
for PV in PVs.... vgcfgrestore
marvin:~/recover/backup# pvscan pvscan -- reading all physical volumes (this may take a while...) pvscan -- ACTIVE PV "/dev/scsi/host0/bus0/target3/lun0/part2" of VG "vg_system" [8.25 GB / 512.00 MB free] pvscan -- inactive PV "/dev/ide/host2/bus1/target0/lun0/part1" of VG "vg_stuff" [76.31 GB / 0 free] pvscan -- inactive PV "/dev/ide/host2/bus1/target1/lun0/part1" of VG "vg_stuff" [76.28 GB / 0 free] pvscan -- inactive PV "/dev/ide/host2/bus0/target0/lun0/part1" of VG "vg_stuff" [76.28 GB / 0 free] pvscan -- inactive PV "/dev/ide/host2/bus0/target1/lun0/part1" of VG "vg_stuff" [38.31 GB / 38.31 GB free] pvscan -- inactive PV "/dev/ide/host0/bus1/target0/lun0/part1" of VG "vg_stuff" [57.22 GB / 56.50 GB free] pvscan -- inactive PV "/dev/ide/host0/bus1/target1/lun0/part1" of VG "vg_stuff" [57.22 GB / 57.22 GB free] pvscan -- inactive PV "/dev/ide/host0/bus0/target1/lun0/part1" of VG "vg_stuff" [38.34 GB / 352.00 MB free] pvscan -- total: 8 [428.54 GB] / in use: 8 [428.54 GB] / in no VG: 0 [0]
marvin:~/recover/backup# vgscan vgscan -- reading all physical volumes (this may take a while...) vgscan -- found active volume group "vg_system" vgscan -- "/etc/lvmtab" and "/etc/lvmtab.d" successfully created vgscan -- WARNING: This program does not do a VGDA backup of your volume group
marvin:~/recover/backup# pvscan pvscan -- reading all physical volumes (this may take a while...) pvscan -- ACTIVE PV "/dev/scsi/host0/bus0/target3/lun0/part2" of VG "vg_system" [8.25 GB / 512.00 MB free] pvscan -- inactive PV "/dev/ide/host2/bus1/target0/lun0/part1" is associated to an unknown VG (run vgscan) pvscan -- inactive PV "/dev/ide/host2/bus1/target1/lun0/part1" is associated to an unknown VG (run vgscan) pvscan -- inactive PV "/dev/ide/host2/bus0/target0/lun0/part1" is associated to an unknown VG (run vgscan) pvscan -- inactive PV "/dev/ide/host2/bus0/target1/lun0/part1" is associated to an unknown VG (run vgscan) pvscan -- inactive PV "/dev/ide/host0/bus1/target0/lun0/part1" is associated to an unknown VG (run vgscan) pvscan -- inactive PV "/dev/ide/host0/bus1/target1/lun0/part1" is associated to an unknown VG (run vgscan) pvscan -- inactive PV "/dev/ide/host0/bus0/target1/lun0/part1" is associated to an unknown VG (run vgscan) pvscan -- total: 8 [428.54 GB] / in use: 8 [428.54 GB] / in no VG: 0 [0]
[upgraded tools and kernel to 1.0.1 (formally 1.0.1rc4)]
Some other idea?
Quoted 8 lines
Could you save your VG's metadata before by running
for PV in YOurPVs
do dd if=/dev/$PV of=VGDA.${VGName}.$PV bs=1k count=512
doneand storing the copies on tape or something so that we are able to backup for potential further investigation?
I put them up at http://www.palfrader.org/~weasel/palfrader-lvm.tar.gz
if you want to fetch it.
yours,
peter
Signature · 4 lines
PGP signed and encrypted | .''`. ** Debian GNU/Linux **
messages preferred. | : :' : The universal
| `. `' Operating System
http://www.palfrader.org/ | `- http://www.debian.org/