Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can't access LVM volume group after changing a non-LVM partition

2 views
Skip to first unread message

Oscar

unread,
Dec 7, 2004, 5:58:53 AM12/7/04
to
After resizing a non-lvm partition I can't get my lvm group back. I
hope you can give me

some advice on how to proceed. The problem was, I think, that by
deleting and re-creating a

partition (using fdisk) all partition names were changed.

Here's what I had and what I did:

- I had a lvm group called data which was formed by the partitions
/dev/hda1, /dev/hda5 and

/dev/hda7. I also had an ext2 filesystem on /dev/hda6.

- I resized (shrinked) the ext2 filesystem on /dev/hda6 (not
important) and then (using

fdisk) I deleted the /dev/hda6 partition and re-created it, but
smaller. This worked great

and the partition was shrinked without problems.
- However, and this is what I think it's the cause of the problem,
when I re-created the

/dev/hda6 partition, all partition numbers were changed: the new
partition was created as

/dev/hda8 instead of /dev/hda6.
- I hadn't noticed this changing of names, so I merrily created a new
partition (using

cfdisk) in the free space I had got by shrinking the partition, and
the new partition was

called /dev/hda6.

Based on start cylinders, it looks like the changes were:
/dev/hda1 to /dev/hda5: unchanged
/dev/hda6: changed into /dev/hda8
/dev/hda7: unchanged
/dev/hda8: lost (it was a swap partition, so I wasn't very worried..)

When I do a vgdisplay this is what I got:
Couldn't find device with uuid
'5VBBLW-70Dj-fwjf-Xvzc-7VZr-icQa-l9XQ2N'.
Couldn't find all physical volumes for volume group data.
Couldn't find device with uuid
'5VBBLW-70Dj-fwjf-Xvzc-7VZr-icQa-l9XQ2N'.
Couldn't find all physical volumes for volume group data.
Volume group "data" doesn't exist

I tried then to trick lvm by changing symlinks: since i'm using devfs
and all hdaX are

symlinks to /dev/ide/host0/bus0/target0/lun0/partX I changed hda8 to
point to ...part6 and

hda6 to point to ...part8.
It didn't work: vgdisplay showed exactly the same message. I put the
symlinks back to how

they were.


Could you give me some clue on how can I get the data volume group
back? Or at least, can I

recover some of its information?

Thanks!!

Oscar.


ps, These are the partition tables before and after the mess:

before:
Device Boot Start End Blocks Id System
/dev/hda1 * 1 1459 11719386 8e Linux LVM
/dev/hda2 1460 3891 19535040 83 Linux
/dev/hda3 3892 14593 85963815 5 Extended
/dev/hda5 3892 5107 9767488+ 8e Linux LVM
/dev/hda6 5108 14225 73240303+ 83 Linux
/dev/hda7 14226 14471 1975963+ 8e Linux LVM
/dev/hda8 14472 14593 979933+ 82 Linux swap

after:
/dev/hda1 * 1 1459 11719386 8e Linux LVM
/dev/hda2 1460 3891 19535040 83 Linux
/dev/hda3 3892 14593 85963815 5 Extended
/dev/hda5 3892 5107 9767488+ 8e Linux LVM
/dev/hda6 11796 14225 19518943+ 8e Linux LVM
/dev/hda7 14226 14471 1975963+ 8e Linux LVM
/dev/hda8 5108 11795 53721328+ 83 Linux

Laurenz Albe

unread,
Dec 9, 2004, 5:30:40 AM12/9/04
to
Oscar <grim...@gmail.com> wrote:
> After resizing a non-lvm partition I can't get my lvm group back. I
> hope you can give me
> some advice on how to proceed. The problem was, I think, that by
> deleting and re-creating a
> partition (using fdisk) all partition names were changed.
>
> When I do a vgdisplay this is what I got:
> Couldn't find device with uuid
> '5VBBLW-70Dj-fwjf-Xvzc-7VZr-icQa-l9XQ2N'.
> Couldn't find all physical volumes for volume group data.
> Volume group "data" doesn't exist
>
> ps, These are the partition tables before and after the mess:
>
> before:
> Device Boot Start End Blocks Id System
> /dev/hda1 * 1 1459 11719386 8e Linux LVM
> /dev/hda2 1460 3891 19535040 83 Linux
> /dev/hda3 3892 14593 85963815 5 Extended
> /dev/hda5 3892 5107 9767488+ 8e Linux LVM
> /dev/hda6 5108 14225 73240303+ 83 Linux
> /dev/hda7 14226 14471 1975963+ 8e Linux LVM
> /dev/hda8 14472 14593 979933+ 82 Linux swap
>
> after:
> /dev/hda1 * 1 1459 11719386 8e Linux LVM
> /dev/hda2 1460 3891 19535040 83 Linux
> /dev/hda3 3892 14593 85963815 5 Extended
> /dev/hda5 3892 5107 9767488+ 8e Linux LVM
> /dev/hda6 11796 14225 19518943+ 8e Linux LVM
> /dev/hda7 14226 14471 1975963+ 8e Linux LVM
> /dev/hda8 5108 11795 53721328+ 83 Linux

Try booting from CD-ROM and use vgimport with the -f flag to get
your LVM back:

vgimport -f -v data /dev/hda1 /dev/hda5 /dev/hda7

When booting from disk next time, save the configuration with
vgcfgbackup.

Yours,
Laurenz Albe

0 new messages