Skip to contentSkip to conversation

PV and disk recovery

linux-lvm Björn Medin 2 participants 2 messages May 25, 2003 – May 27, 2003

lore
Share & tools
lore
#0 lore raw

Hello,

I had a VG with two full disks in two PV:s (/dev/hda1 and /dev/hdb1). The second drive, a new IBM 120GB disk fried after some weeks and was totally inacessable (not even recognised by BIOS).

To my understanding the first PV on /dev/hda1 is OK

Can I recover and get back access to my old data that was on /dev/hda1? I have tried various things suggested in HOWTO:s and this list.

If I do vgscan I get:

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 "Volume00" 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

Any command like vgchange -a y only gets: vgchange -- no volume groups found

I have tried create a new VG: vgcreate extra /dev/hda1

but I then get:
vgcreate -- "/dev/hda1" is not a new physical volume vgcreate -- physical volume "/dev/hda1" already belongs to volume group "Volume00"

-----------

Seems like I dont have any config data for Volume00 left but still I am not allowed to use/change Volume00 or the PV.

What can I do? Is there any way to reclaim possible intact data on my old /dev/hda1????

Thanks!

/Björn

#1 lore raw

Björn,

there's 3 options you've got (loosing all data on the gone PV in any):

o the official LVM1 way (presuming you've got metadata archives in /etc/lvmconf/ still) is to get a replacement drive (of the same size) and vgcfgrestore the LVM metadata to it after running pvcreate. "vgscan;vgchange -ay" activates your VG again.
You have the option to overwrite the PV size with "pvcreate -s ..." in recent LVM1 versions.

o use LVM2; support to activate partially available VGs has been added to it (vgchange -P -ay Volume00"). Install device-mapper and LVM2 from www.sistina.com if you want to follow this path.

o the hacky LVM1 one, if you still have your VG backup in /etc/lvmconf (no need for a replacement drive but taking io errors accessing the missing PV)
- mkdir /etc/lvmtab.d
- cp /etc/lvmconf/Volume00.conf /etc/lvmtab.d
- echo -ne "Volume00\0" > /etc/lvmtab
- vgchange -ay Volume00

Once you've got access to your VG back with either of those options, you can check the mapping of the LVs with
"lvdisplay -v /dev/Volume00/YourLVName" to find out, which parts (logical extents) of the logical volumes address space are still accessable (and which ones are not, because they were on the dead drive).

FYI: you ask for trouble using filesystems in case of partially
accessable LVs because typically inmportant areas of the metadata and data will be inaccessable.

Regards,
Heinz -- The LVM Guy --

Quoted 47 lines · Björn Medin

Hello,

I had a VG with two full disks in two PV:s (/dev/hda1 and /dev/hdb1). The second drive, a new IBM 120GB disk fried after some weeks and was totally inacessable (not even recognised by BIOS).

To my understanding the first PV on /dev/hda1 is OK

Can I recover and get back access to my old data that was on /dev/hda1? I have tried various things suggested in HOWTO:s and this list.

If I do vgscan I get:

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 "Volume00" 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

Any command like vgchange -a y only gets: vgchange -- no volume groups found

I have tried create a new VG: vgcreate extra /dev/hda1

but I then get:
vgcreate -- "/dev/hda1" is not a new physical volume vgcreate -- physical volume "/dev/hda1" already belongs to volume group "Volume00"

-----------

Seems like I dont have any config data for Volume00 left but still I am not allowed to use/change Volume00 or the PV.

What can I do? Is there any way to reclaim possible intact data on my old /dev/hda1????

Thanks!

/Björn

Quoted 5 lines

_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.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 Sistina Software Inc.
Senior Consultant/Developer Am Sonnenhang 11
56242 Marienrachdorf Germany
[email protected] +49 2626 141200

                                                       FAX 924446

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