Skip to contentSkip to conversation

restoring volume group from file

linux-lvm James W Anderson 2 participants 4 messages Apr 24, 2003 – Apr 28, 2003

lore
Share & tools
lore
#0 lore raw

Hi,

I recently made a copy of an lvm partition to a file, using dd:

dd if=/dev/hde5 of=lvm-file bs=...

I would now like to mount this file, which contains a single volume group, on a different machine. Here is what I have done so far:

1) create a loopback device for the file

# losetup /dev/loop0 lvm-file

2) pvscan, detects the volume group

# pvscan
pvscan -- reading all physical volumes (this may take a while...)
pvscan -- inactive PV "/dev/loop0" of VG "vg00" [23.45 GB / 3.20 GB free]
pvscan -- total: 1 [23.46 GB] / in use: 1 [23.46 GB] / in no VG: 0 [0]

3) Now, when I try to do vgcfgrestore, I get the following error:

# vgcfgrestore -n vg00 -f vg00.conf -o /dev/hde5 /dev/loop0
vgcfgrestore -- size of physical volume /dev/loop0 differs from backup

I tried passing the -i option to tell it to ignore the size difference, and then it did create the volume group, but all of the logical volumes are unusable---e2fsck cannot find the superblocks on the filesystems.

Does anyone have any suggestions as to what I might try to get this to work? Any help would be tremendously appreciated.

Many thanks,
James

#1 lore raw

James,

sounds like you had a problem with your LVs before you copied already, which I assume was the reason to copy hde5 and run vgcfgrestore.

What does vgck (metadata checker) display ?

Maybe you have better luck with an older metadata backup from /etc/lvmconf ?

Quoted 43 lines · James W Anderson

Hi,

I recently made a copy of an lvm partition to a file, using dd:

dd if=/dev/hde5 of=lvm-file bs=...

I would now like to mount this file, which contains a single volume group, on a different machine. Here is what I have done so far:

1) create a loopback device for the file

# losetup /dev/loop0 lvm-file

2) pvscan, detects the volume group

# pvscan
pvscan -- reading all physical volumes (this may take a while...)
pvscan -- inactive PV "/dev/loop0" of VG "vg00" [23.45 GB / 3.20 GB free]
pvscan -- total: 1 [23.46 GB] / in use: 1 [23.46 GB] / in no VG: 0 [0]

3) Now, when I try to do vgcfgrestore, I get the following error:

# vgcfgrestore -n vg00 -f vg00.conf -o /dev/hde5 /dev/loop0
vgcfgrestore -- size of physical volume /dev/loop0 differs from backup

I tried passing the -i option to tell it to ignore the size difference, and then it did create the volume group, but all of the logical volumes are unusable---e2fsck cannot find the superblocks on the filesystems.

Does anyone have any suggestions as to what I might try to get this to work? Any help would be tremendously appreciated.

Many thanks,
James

_______________________________________________
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/

Signature · 15 lines
Regards,
Heinz    -- The LVM Guy --

*** 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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#2 lore raw

Thanks for responding.

vgck seems to say that things are alright:

# vgck /dev/vg00
vgck -- VGDA of "vg00" in lvmtab is consistent
vgck -- VGDA of "vg00" on physical volume is consistent

I also did try to restore all of the old metadata backups, but to no avail.

Do you have any other suggestions? I still do not understand why vgcfgrestore say that the sizes are different, since I did a block-by-block copy from the original partition.

Thank you again for your help.

Quoted 50 lines · Heinz J . Mauelshagen

James,

sounds like you had a problem with your LVs before you copied already, which I assume was the reason to copy hde5 and run vgcfgrestore.

What does vgck (metadata checker) display ?

Maybe you have better luck with an older metadata backup from /etc/lvmconf ?

Quoted 38 lines · James W Anderson

Hi,

I recently made a copy of an lvm partition to a file, using dd:

dd if=/dev/hde5 of=lvm-file bs=...

I would now like to mount this file, which contains a single volume group, on a different machine. Here is what I have done so far:

1) create a loopback device for the file

# losetup /dev/loop0 lvm-file

2) pvscan, detects the volume group

# pvscan
pvscan -- reading all physical volumes (this may take a while...)
pvscan -- inactive PV "/dev/loop0" of VG "vg00" [23.45 GB / 3.20 GB free]
pvscan -- total: 1 [23.46 GB] / in use: 1 [23.46 GB] / in no VG: 0 [0]

3) Now, when I try to do vgcfgrestore, I get the following error:

# vgcfgrestore -n vg00 -f vg00.conf -o /dev/hde5 /dev/loop0
vgcfgrestore -- size of physical volume /dev/loop0 differs from backup

I tried passing the -i option to tell it to ignore the size difference, and then it did create the volume group, but all of the logical volumes are unusable---e2fsck cannot find the superblocks on the filesystems.

Does anyone have any suggestions as to what I might try to get this to work? Any help would be tremendously appreciated.

Many thanks,
James

#3 lore raw
Quoted 8 lines · James W Anderson

Thanks for responding.

vgck seems to say that things are alright:

# vgck /dev/vg00
vgck -- VGDA of "vg00" in lvmtab is consistent
vgck -- VGDA of "vg00" on physical volume is consistent

Odd, vgscan should find your VG fine in that case :(
You say that fsck can't find the superblocks but can you read (dd) the LVs fine after the restore ?

Quoted 6 lines

I also did try to restore all of the old metadata backups, but to no avail.

Do you have any other suggestions? I still do not understand why vgcfgrestore say that the sizes are different, since I did a block-by-block copy from the original partition.

vgcfgrestore checks the _exact_ size of the PV before restorring the meatadata. To get around this constraint which is aiming to prove that the device to restore to is the right one, user can use the ignore flag if (s)he knows what (s)he's doing ;)

Regards,
Heinz -- The LVM Guy --

Quoted 55 lines

Thank you again for your help.

Quoted 6 lines · Heinz J . Mauelshagen

James,

sounds like you had a problem with your LVs before you copied already, which I assume was the reason to copy hde5 and run vgcfgrestore.

Quoted 44 lines

What does vgck (metadata checker) display ?

Maybe you have better luck with an older metadata backup from /etc/lvmconf ?

Quoted 38 lines · James W Anderson

Hi,

I recently made a copy of an lvm partition to a file, using dd:

dd if=/dev/hde5 of=lvm-file bs=...

I would now like to mount this file, which contains a single volume group, on a different machine. Here is what I have done so far:

1) create a loopback device for the file

# losetup /dev/loop0 lvm-file

2) pvscan, detects the volume group

# pvscan
pvscan -- reading all physical volumes (this may take a while...)
pvscan -- inactive PV "/dev/loop0" of VG "vg00" [23.45 GB / 3.20 GB free]
pvscan -- total: 1 [23.46 GB] / in use: 1 [23.46 GB] / in no VG: 0 [0]

3) Now, when I try to do vgcfgrestore, I get the following error:

# vgcfgrestore -n vg00 -f vg00.conf -o /dev/hde5 /dev/loop0
vgcfgrestore -- size of physical volume /dev/loop0 differs from backup

I tried passing the -i option to tell it to ignore the size difference, and then it did create the volume group, but all of the logical volumes are unusable---e2fsck cannot find the superblocks on the filesystems.

Does anyone have any suggestions as to what I might try to get this to work? Any help would be tremendously appreciated.

Many thanks,
James

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

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