Skip to contentSkip to conversation

Lost free PV -> error reading VG

linux-lvm Stefan Jenkner 3 participants 5 messages Feb 18, 2004 – Feb 20, 2004

lore
Share & tools
lore
#0 lore raw

Hi Folks!

I had a vg "debian" with the pvs /dev/hda2 /dev/hda3 /dev/hda4 I wanted to remove /dev/hda4, so i did: pvmove -v /dev/hda4 Everything went well, so I removed /dev/hda4, but _without_ the use of:
vgreduce debian /dev/hda4 :-(
I also did: pvcreate /dev/hda4 , so /dev/hda4 seems to be an empty pv, and it does not know that it belongs
to the vg "debian".

And now, I get:

root@ttyp0[root]# vgscan 
vgscan -- reading all physical volumes (this may take a while...)
vgscan -- ERROR "vg_read_with_pv_and_lv(): current PV" can't get data of
volume group "debian" from physical volume(s)
vgscan -- "/etc/lvmtab" and "/etc/lvmtab.d" successfully created
vgscan -- WARNING: This program does not do a VGDA backup of your volume
group
root@ttyp0[root]# pvscan 
pvscan -- reading all physical volumes (this may take a while...)
pvscan -- inactive PV "/dev/hda2"  is associated to unknown VG "debian" (run
vgscan)
pvscan -- inactive PV "/dev/hda3"  is associated to unknown VG "debian" (run
vgscan)
pvscan -- inactive PV "/dev/hda4" is in no VG  [23.85 GB]
pvscan -- total: 3 [57.24 GB] / in use: 2 [33.38 GB] / in no VG: 1 [23.85
GB]

How can I recover my vg? There are no backups :-(
How can I tell the vg "debian" to do not use: the empty pv /dev/hda4? Or, how can I tell /dev/hda4 that it belongs to the vg "debian"? There is no lvmconf too :-(

What additional information do you need to be able to help me?

Thanks
Stefan

Signature · 2 lines
GMX ProMail (250 MB Mailbox, 50 FreeSMS, Virenschutz, 2,99 EUR/Monat...)
jetzt 3 Monate GRATIS + 3x DER SPIEGEL +++ http://www.gmx.net/derspiegel +++
#1 lore raw
Quoted 6 lines · Stefan Jenkner

Hi Folks!

I had a vg "debian" with the pvs /dev/hda2 /dev/hda3 /dev/hda4 I wanted to remove /dev/hda4, so i did: pvmove -v /dev/hda4 Everything went well, so I removed /dev/hda4, but _without_ the use of:
vgreduce debian /dev/hda4 :-(

D'oh!

Quoted 3 lines

I also did: pvcreate /dev/hda4 , so /dev/hda4 seems to be an empty pv, and it does not know that it belongs
to the vg "debian".

Must have been a "pvcreate -ff /dev/hda4" to achive the recreation, while /dev/hda4 was a member of VG "debian" still.

Quoted 21 lines

And now, I get:

root@ttyp0[root]# vgscan 
vgscan -- reading all physical volumes (this may take a while...)
vgscan -- ERROR "vg_read_with_pv_and_lv(): current PV" can't get data of
volume group "debian" from physical volume(s)
vgscan -- "/etc/lvmtab" and "/etc/lvmtab.d" successfully created
vgscan -- WARNING: This program does not do a VGDA backup of your volume
group
root@ttyp0[root]# pvscan 
pvscan -- reading all physical volumes (this may take a while...)
pvscan -- inactive PV "/dev/hda2"  is associated to unknown VG "debian" (run
vgscan)
pvscan -- inactive PV "/dev/hda3"  is associated to unknown VG "debian" (run
vgscan)
pvscan -- inactive PV "/dev/hda4" is in no VG  [23.85 GB]
pvscan -- total: 3 [57.24 GB] / in use: 2 [33.38 GB] / in no VG: 1 [23.85
GB]
Quoted 1 line

How can I recover my vg? There are no backups :-(

/me wonders how often we mentioned to take backups of /etc/lvmconf/* yet :->

Quoted 3 lines

How can I tell the vg "debian" to do not use: the empty pv /dev/hda4? Or, how can I tell /dev/hda4 that it belongs to the vg "debian"? There is no lvmconf too :-(

lvm2 tools are able to reduce VGs by missing PVs. Fetch and build them and run "vgreduce --removemissing debian".

Afterwards continue with LVM1 (unless you want to migrate to LVM2 anyway):

# vgscan -f
# vgchange -ay
Quoted 15 lines

What additional information do you need to be able to help me?

Thanks
Stefan

Signature · 8 lines
GMX ProMail (250 MB Mailbox, 50 FreeSMS, Virenschutz, 2,99 EUR/Monat...)
jetzt 3 Monate GRATIS + 3x DER SPIEGEL +++ http://www.gmx.net/derspiegel +++

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
Signature · 15 lines
Regards,
Heinz    -- The LVM Guy --

*** Software bugs are stupid.
    Nevertheless it needs not so stupid people to solve them ***

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Heinz Mauelshagen                                 Red Hat, Inc.
Consulting Development Engineer                   Am Sonnenhang 11
                                                  56242 Marienrachdorf
                                                  Germany
[email protected]                            +49 2626 141200
                                                       FAX 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#2 lore raw
Quoted 3 lines · Heinz Mauelshagen

/me wonders how often we mentioned to take backups of /etc/lvmconf/* yet :->

From a Users point of view:
If you run vgscan, and it even mentions something about

a) REBuilding /etc/lvmwhatever
and
b) it fails for *any* reason,

people, me included, delete /etc/lvm* to start "clean", and give vgscan the opportunity to start fresh, without any "corrupted" data.

I dont know how often I nuked the backups, even after i knew that deleting /etc/lvm* is not a good idea. Its like a reflex.

-Christian

Signature · 5 lines
Christian Reiss <[email protected]>
demonserver.de

Key fingerprint = 2999 B7CD A218 06DF D658  5BE3 18B6 B232 02FF 71B2
Public Key can be obtained here: http://www.demonlord.de/pgp.txt
#3 lore raw

Christian,

never "rm -r /etc/lvm*" !!!

o vgscan deletes and creates /etc/lvmtab and volume group backup files in /etc/lvmtab.d/ new

o /etc/lvmconf/ archive files get updated by _any_ configuration changing command or by explicitely running vgcfgbackup

Of course you might want to remove certain archive files from /etc/lvmconf/ after many configuration changes because archives of removed VGs don't get deleted automatically for obvious reasons.

But yuu *never* *ever* want to do that without having an actual backup of /etc/lvmconf/*.

FYI: LVM2 keeps metadata backups and archives uin different locations
(see /etc/lvm/lvm.conf there)

Regards,
Heinz -- The LVM Guy --

Quoted 18 lines · Christian Reiss
Quoted 4 lines · Heinz Mauelshagen

/me wonders how often we mentioned to take backups of /etc/lvmconf/* yet :->

From a Users point of view:
If you run vgscan, and it even mentions something about

a) REBuilding /etc/lvmwhatever
and
b) it fails for *any* reason,

people, me included, delete /etc/lvm* to start "clean", and give vgscan the opportunity to start fresh, without any "corrupted" data.

Quoted 21 lines

I dont know how often I nuked the backups, even after i knew that deleting /etc/lvm* is not a good idea. Its like a reflex.

-Christian

Signature · 11 lines
Christian Reiss <[email protected]>
demonserver.de

Key fingerprint = 2999 B7CD A218 06DF D658  5BE3 18B6 B232 02FF 71B2
Public Key can be obtained here: http://www.demonlord.de/pgp.txt

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

*** Software bugs are stupid.
Nevertheless it needs not so stupid people to solve them ***

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Heinz Mauelshagen Red Hat GmbH
Consulting Development Engineer Am Sonnenhang 11
56242 Marienrachdorf Germany
[email protected] +49 2626 141200

                                                       FAX 924446

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

#4 lore raw
In reply to Heinz Mauelshagen
Quoted 4 lines

[...]

lvm2 tools are able to reduce VGs by missing PVs. Fetch and build them and run "vgreduce --removemissing debian"

Thanks a lot!
I did it the LVM2-way!

Regards,
Stefan

Signature · 2 lines
GMX ProMail (250 MB Mailbox, 50 FreeSMS, Virenschutz, 2,99 EUR/Monat...)
jetzt 3 Monate GRATIS + 3x DER SPIEGEL +++ http://www.gmx.net/derspiegel +++