Recover LVM2 volume group after one HDD failed

Posted by Bernd on Super User See other posts from Super User or by Bernd
Published on 2011-11-17T18:18:43Z Indexed on 2011/11/20 1:58 UTC
Read the original article Hit count: 407

Filed under:
|
|

I had two HDDs, each one containing a LVM partition which formed a volume group. Then I had two LVs, one for my / directory and one for my /home/ directory. Yesterday where I had my / dir failed. I'm trying to recover at least my /home/ dir.

What I've done so far:

  1. Boot a live system
  2. Extract LVM2 metadata from the working HDD using dd
  3. Copy metadata to /etc/lvm/backup/vg0

Now I'm trying to do this:

pvcreate --restore /etc/lvm/backup/vg0 --uuid "[uuid of my working hdd]" /dev/sdb2

But I always get:

Couldn't find device with uuid '[uuid of broken hdd]'.
Couldn't find device with uuid '[uuid of working hdd]'.
Device /dev/sdb2 not found (or ignored by filtering).

I confirmed that /dev/sdb2 exists and I've commented out all filtering settings from /etc/lvm/lvm.conf so I don't know what might be causing pvcreate not to find the device.

So:

  • What might be the problem?
  • Is it even possible to restore this partition? (As I'm writing this I'm starting to think it's impossible D:)

Edit: Okay, looks like I've got it figured out. I was using a Ubuntu 8.10 CD (yeah, I know it's not supported anymore) and it seems that was the problem. When I started from a Ubuntu 10.04 CD everything worked 'fine', I could mount my LVM partitions partially without problems. (Will answer the question in 4 hours. But if anyone has still got some hints/tips, please share! :)

© Super User or respective owner

Related posts about linux

Related posts about ubuntu