[linux-lvm] Recovering LVM partition after OS reinstallation

Jaroslav Stava jstava at redhat.com
Fri Sep 12 16:48:31 UTC 2008


hanocri wrote:
> After root filesystem failure my "/" was all messed up so i had to
> install system from scratch (Debian Unstable). /home is on separate
> LVM partition and (i hope so) intact. However pvscan and vgscan gives
> no result. According to fdisk partition is marked as "8e  Linux LVM".
> I have LVM metadata backup which you can find here:
> http://pastebin.com/m5a13d266
> At line 23 there is: 'device = "/dev/dm-7"    # Hint only ', but there
> is no such device as /dev/dm-7. I think it should be rather /dev/dm-6
> (I'm using dmraid), again according to fdisk - the size and type is
> correct.
> Should I change dm-7 into dm-6 or simply ignore it and do
> vgcfgrestore? And what does ' #Hint only' mean? Or maybe there is
> other way to recover LVM config?
>
> Thanks for any help.
>
>   
Check dmraid. Twice.

If *scan can't find a lvm pv, than there is something wrong.
(unless you are filtering out /dev/dm* - check filter= in lvm.conf)

Did you (or the Debian installation) change the partition layout?
Where did you install the system to? I assume not to the old
"lvroot" logical volume.

Partition type (fdisk) means quite nothing.
If the device/partition is a lvm PV, then there should be an lvm
label at the beginning. That's what vgscan is looking for (see -vvv).
If there is no label at the beginning, then:
- we are looking at the wrong place - partition layout changed or
  perhaps dmraid changed it's mapping
- we are looking at the correct place, but the label is not there
 
You could try looking for the label at other places - man pvck.

Either way provide some info:
"lvmdump -m -a" can automate that
or at least post dmsetup table, vgscan -vvv
dmraid information

Regards,
Jaroslav Stava






More information about the linux-lvm mailing list