LVM ate my data!
Hiya.
I've just upgraded my kernel, and on booting my LVM setup isn't
recognised. Going back to the old kernel, it still isn't.
Running vgscan gives:
vgscan -- reading all physical volumes (this may take a while...)
vgscan -- found inactive volume group "pvg"
vgscan -- ERROR "vg_read_with_pv_and_lv(): allocated LE of LV" can't get data of volume group "pvg" from physical volume(s) vgscan -- ERROR "vg_read_with_pv_and_lv(): allocated LE of LV" creating "/etc/lvmtab" and "/etc/lvmtab.d"
OK, create a new vg and import?
vgcreate gives:
vgcreate -- ERROR: "/etc/lvmtab" doesn't exist; please run vgscan and pvscan gives:
pvscan -- reading all physical volumes (this may take a while...) pvscan -- inactive PV "/dev/hda3" is associated to an unknown VG (run vgscan) pvscan -- inactive PV "/dev/hda4" is associated to an unknown VG (run vgscan) pvscan -- total: 2 [16.88 GB] / in use: 2 [16.88 GB] / in no VG: 0 [0]
Where do I go from here - vgcfgrestore? uuid_fixer? Even something really smelly! Thanks,
Bill
(Sorry if this comes over a bit garbled, I'm posting using lynx, 'coz pine's somewhere on /dev/hda4 ...)
Quoted 9 lines · On Mon, Feb 25, 2002 at 06:09:09PM +0000, [email protected] wrote:
Hiya.
I've just upgraded my kernel, and on booting my LVM setup isn't
recognised. Going back to the old kernel, it still isn't.
Running vgscan gives:
vgscan -- reading all physical volumes (this may take a while...)
vgscan -- found inactive volume group "pvg"
vgscan -- ERROR "vg_read_with_pv_and_lv(): allocated LE of LV" can't get data of volume group "pvg" from physical volume(s) vgscan -- ERROR "vg_read_with_pv_and_lv(): allocated LE of LV" creating "/etc/lvmtab" and "/etc/lvmtab.d"
In case *all* your PVs making up your VG are accessable, your LVM metadata looks toasted.
Quoted 1 line
OK, create a new vg and import?
No.
You need to "pvcreate -ff" your PVs and vgcfgrestore a metadata backup to all of them.
Before doing so, you can save your actual metadata for recovery in case something goes badly wrong with:
for d in /dev/hda[34]
do
dd if=$d of=$(basename $d).vgda bs=1k count=1k
done
So, assuming /dev/hda[34] are all your PVs which belonged to the missing VG (otherwise add those), figure out the recent metadata backup in /etc/lvmconf. Say /etc/lvmconf/VG.conf would be the one.
Then run:
pvcreate -yff /dev/hda[34]
vgcfgrestore -n YourVGName /dev/hda3
vgcfgrestore -n YourVGName /dev/hda4
vgscan
vgchange -ay
Quoted 9 lines
vgcreate gives:
vgcreate -- ERROR: "/etc/lvmtab" doesn't exist; please run vgscan and pvscan gives:
pvscan -- reading all physical volumes (this may take a while...) pvscan -- inactive PV "/dev/hda3" is associated to an unknown VG (run vgscan) pvscan -- inactive PV "/dev/hda4" is associated to an unknown VG (run vgscan) pvscan -- total: 2 [16.88 GB] / in use: 2 [16.88 GB] / in no VG: 0 [0]Where do I go from here - vgcfgrestore?
uuid_fixer? Even something really smelly!
Please upgrade to LVM 1.0.3 and do the pvcreate + vgcfgrestore above.
Quoted 11 lines
Thanks,
Bill
(Sorry if this comes over a bit garbled, I'm posting using lynx, 'coz pine's somewhere on/dev/hda4...)_______________________________________________
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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-Quoted 2 lines · Heinz J . Mauelshagen
In case *all* your PVs making up your VG are accessable, your LVM metadata looks toasted.
The bootup should just run "vgchange -ay", ah well!
Quoted 4 lines
You need to "pvcreate -ff" your PVs and vgcfgrestore a metadata backup to all of them.
Before doing so, you can save your actual metadata for recovery in case something goes badly wrong with:
OK, metadata saved.
Quoted 5 lines
So, assuming /dev/hda[34] are all your PVs which belonged to the missing VG (otherwise add those), figure out the recent metadata backup in
/etc/lvmconf. Say/etc/lvmconf/VG.confwould be the one.Then run:
Using the 1.0.3 versions...
Quoted 1 line
pvcreate -yff /dev/hda[34]
pvcreate -- WARNING: forcing physical volume creation on "/dev/hda3" of volume group "pvg"
pvcreate -- physical volume "/dev/hda3" successfully created pvcreate -- WARNING: forcing physical volume creation on "/dev/hda4" of volume group "pvg"
pvcreate -- physical volume "/dev/hda4" successfully created
Quoted 1 line
vgcfgrestore -n YourVGName
/dev/hda3
vgcfgrestore -- INFO: using backup file "/etc/lvmconf/pvg.conf" vgcfgrestore -- ERROR: different structure size stored in "/etc/lvmconf/pvg.conf" than expected in file vg_cfgrestore.c [line 139] vgcfgrestore -- ERROR "vg_cfgrestore(): read" restoring volume group "pvg"
Hmm. Same for ./vgcfgrestore -f /etc/lvmconf/pvg.conf*
Quoted 5 lines
vgcfgrestore -n YourVGName
/dev/hda4
vgscan
vgchange -ayPlease upgrade to LVM 1.0.3 and do the pvcreate + vgcfgrestore above.
Got 1.0.3 Should I try the vgcfgresore with the old tools (v0.9)???
BTW, thanks very much for getting back so rapidly!
Thanks,
Bill
Wahey - I got my data back, thankyou!
Quoted 5 lines
pvcreate -yff /dev/hda[34]
vgcfgrestore -n YourVGName/dev/hda3
vgcfgrestore -n YourVGName/dev/hda4
vgscan
vgchange -ay
What I did, from .bash_history
rm -rf /etc/lvmtab /etc/lvmtab.d /dev/pvg # I had backed up already. ~/LVM/1.0.3/tools/vgscan
~/LVM/1.0.3/pvcreate -yff /dev/hda[34]
vgcfgrestore -n pvg /dev/hda3
vgcfgrestore -n pvg /dev/hda4
~/uuid_fixer/uuid_fixer /dev/hda3 /dev/hda4 ~/LVM/1.0.3/tools/vgscan
~/LVM/1.0.3/tools/vgchange -ay
mount -treiserfs /dev/pvg/1 /mnt/dat
Don't know how much of that was needed...
I had been playing with snapshots recently, but they didn't seem to work with my ancient (2.4.3) kernel. Could that have been the cause?
Thanks!
Bill
Quoted 19 lines · wbh
Wahey - I got my data back, thankyou!
Quoted 5 lines
pvcreate -yff /dev/hda[34]
vgcfgrestore -n YourVGName/dev/hda3
vgcfgrestore -n YourVGName/dev/hda4
vgscan
vgchange -ayWhat I did, from .bash_history
rm -rf/etc/lvmtab/etc/lvmtab.d/dev/pvg# I had backed up already. ~/LVM/1.0.3/tools/vgscan
~/LVM/1.0.3/pvcreate -yff /dev/hda[34]
vgcfgrestore -n pvg/dev/hda3
vgcfgrestore -n pvg/dev/hda4
~/uuid_fixer/uuid_fixer/dev/hda3/dev/hda4~/LVM/1.0.3/tools/vgscan
~/LVM/1.0.3/tools/vgchange -ay
mount -treiserfs/dev/pvg/1/mnt/dat
Quoted 1 line
Don't know how much of that was needed...
All of that probably.uuid_fixer covers a bug in older vgcfgrestore versions which prevented correct restores of the PV UUID tables to all PVs.
Quoted 3 lines
I had been playing with snapshots recently, but they didn't seem to work with my ancient (2.4.3) kernel. Could that have been the cause?
In case you haven't patched in the newest LVM driver code following the instrcutions in PATCHES/README contained in the LVM distro -> yes.
Quoted 10 lines
Thanks!
Bill_______________________________________________
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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-Quoted 30 lines · wbh
Quoted 2 lines · Heinz J . Mauelshagen
In case *all* your PVs making up your VG are accessable, your LVM metadata looks toasted.
The bootup should just run "vgchange -ay", ah well!
Quoted 4 lines
You need to "pvcreate -ff" your PVs and vgcfgrestore a metadata backup to all of them.
Before doing so, you can save your actual metadata for recovery in case something goes badly wrong with:OK, metadata saved.
Quoted 5 lines
So, assuming /dev/hda[34] are all your PVs which belonged to the missing VG (otherwise add those), figure out the recent metadata backup in
/etc/lvmconf. Say/etc/lvmconf/VG.confwould be the one.Then run:
Using the 1.0.3 versions...
Quoted 1 line
pvcreate -yff /dev/hda[34]
pvcreate -- WARNING: forcing physical volume creation on "
/dev/hda3" of volume group "pvg"
pvcreate -- physical volume "/dev/hda3" successfully created pvcreate -- WARNING: forcing physical volume creation on "/dev/hda4" of volume group "pvg"
pvcreate -- physical volume "/dev/hda4" successfully created
Quoted 5 lines
Quoted 1 line
vgcfgrestore -n YourVGName
/dev/hda3vgcfgrestore -- INFO: using backup file "
/etc/lvmconf/pvg.conf" vgcfgrestore -- ERROR: different structure size stored in "/etc/lvmconf/pvg.conf" than expected in filevg_cfgrestore.c[line 139] vgcfgrestore -- ERROR "vg_cfgrestore(): read" restoring volume group "pvg"
Oops. Forgot that one.
If you have a rather old LVM version in use, the VGDA backups can only be restored using that version specific vgcfgrestore.
So, you absolutely did the right things you reported in your previous email.
Quoted 10 lines
Hmm. Same for ./vgcfgrestore -f
/etc/lvmconf/pvg.conf*Quoted 5 lines
vgcfgrestore -n YourVGName
/dev/hda4
vgscan
vgchange -ayPlease upgrade to LVM 1.0.3 and do the pvcreate + vgcfgrestore above.
Got 1.0.3 Should I try the vgcfgresore with the old tools (v0.9)???
Yes, as you already did :-)
The new vgcfgrestore makes uuid_fixer obsolete in case you should run into such problem again.
Quoted 12 lines
BTW, thanks very much for getting back so rapidly!
Thanks,
Bill_______________________________________________
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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-