[clug] LVM recovery -- Canberra LUG a last resort!

Daniel Rose drose at nla.gov.au
Sun Nov 4 00:47:51 GMT 2007


Hi everyone,

I'd really really like some help with LVM, and it's probably not very hard.

I will happily pay for a good result, with cash, physical labour,
charitable donations, catering for the next meeting or anything else you
like.  I'm in Belconnen.

I've tried people on IRC, 2 web forums, two well-respected peers and the
man pages, but I'm really, really stuck.

I have the hard drive from an SME server (aka e-smith, at contribs.org)
which I wish to read data from.

The hardware is fine.  There are 2 partitions, /boot and an LVM
partition which has root and swap partitions 'inside'.

I found that my other box couldn't read the LVM software raid partition,
probably because the kernel had no md support.  That's fixed now, but in
trying various commands I have changed something which should not have
changed, and the drive no longer boots by itself (can't find the raid
set 'main')

All I think I've altered on disk are these bytes near the beginning of
the partition.

[...binary...]LABELONE  [...binary...]  LVM2
0016oVVgdWIVKqB0yPXk2Acu5ZxcIgMj5JD [...binary...]

By doing
pvcreate -u 6oVVgd-WIVK-qB0y-PXk2-Acu5-ZxcI-gMj5JD /dev/hdd2
Software RAID md superblock detected on /dev/hdd2. Wipe it? [y/n] n
Physical volume “/dev/hdd2″ successfully created

As suggested by someone somewhere on the Internet.

After this, a pvdisplay shows good info, but a second run of pvdisplay
shows nothing.  Something strange happens during the execution of
pvdisplay so that subsequent runs of the command find nothing.

The data on disk does not change between good and bad runs of pvdisplay;
at least, not the first 10kbytes.

Normally I think after the pvcreate succeeds, one should be able to make
a volume group, however:

 vgcreate -v main  /dev/hdd2
    Wiping cache of LVM-capable devices
    Adding physical volume '/dev/hdd2' to volume group 'main'
  /dev/hdd2 not identified as an existing physical volume
  Unable to add physical volume '/dev/hdd2' to volume group 'main'.

Which is a shame.


So... I'm not sure what's going on.  Further along the disk can be found
text files detailing the construction, first with seqno1, 2 and finally
this (edited) promise of potential success:

main {
id = "em7z2K-GhvB-mpW4-YNjE-SiZ7-zia2-PIObh2"
seqno = 3
status = ["RESIZEABLE", "READ", "WRITE"]
extent_size = 65536
max_lv = 0
max_pv = 0
physical_volumes {    pv0 {    id = "6oVVgd-WIVK-qB0y-PXk2-Acu5-ZxcI-gMj5JD"
device = "/dev/md2"
status = ["ALLOCATABLE"]
pe_start = 384
pe_count = 2381}}

logical_volumes {   root {id = "Cu9udo-QFcL-72XW-G1OU-1sQA-giBa-WASzs2"
status = ["READ", "WRITE", "VISIBLE"]
segment_count = 1
segment1 { start_extent = 0 extent_count = 2372 type = "striped"
stripe_count = 1        # linear
stripes = [ "pv0", 0]}}

swap {id = "aM7Jm4-QfMW-4y2c-zCv3-0O6f-CVzz-P3Ebg4"
status = ["READ", "WRITE", "VISIBLE"]
segment_count = 1
segment1 {start_extent = 0 extent_count = 8 type = "striped"
stripe_count = 1        # linear
stripes = [ "pv0", 2372 ]}}}}
# Generated by LVM2: Tue Nov 21 18:40:21 2006


It seems to me that given this information, it should not be
particularly difficult to do this.  I'm impatient though, and I don't
have a ready 80Gb to dump a copy to, and I'm stressed that I'll break
something important if I keep trying different things.

I'd be delighted if anyone is interested in offering any advice at all;
I can even enable remote ssh for anyone feeling particularly generous
with their time.


Regards,

Daniel Rose


More information about the linux mailing list