Skip to contentSkip to conversation

Recovery of LVM after kernelupdate (2.4.10 -> 2.4.19)

linux-lvm Thomas Mellenthin 2 participants 4 messages Nov 19, 2002 – Nov 25, 2002

lore
Share & tools
lore
#0 lore raw

Hello,

does anyone of you know, whether it is possible to restore an LVM just from the physical volumes and the VG.conf file ?

I did an update from Kernel 2.4.10 (SuSE 7.3) to 2.4.19 (SuSE 8.1) with the result that no volume groups are found :-(

My LVM structure is like this:
The only volume group is "hxvg01" which contains two volumes "hxlv01" (pv: hdc1, hdd1) and "hxlv02" (pv: hdb1)

I tried to use vgcfgrestore (@SuSE 8.1), but it failed with this messages:

vgcfgrestore -- INFO: using backup file "/etc/lvmconf/hxvg01.conf" vgcfgrestore -- ERROR: different structure size stored in "/etc/lvmconf/hxvg01.conf" than expected in file vg_cfgrestore.c [line 139] vgcfgrestore -- ERROR "vg_cfgrestore(): read" restoring volume group "hxvg01"

Is this the often discussed "compatibility problem" ? How can I safe migrate to
the new LVM Version without loosing all my data OR (if it is not possible) how
can I access my LVM on a Linux 2.4.10 System ?

The vgcfgrestore-step taken on a minimal Linux (SuSE 7.3) with Kernel 2.4.10 shows that
following result. Which steps are necessary to access my volumes under Kernel 2.4.10 ?
Is it possible to import the VG using the -f parameter of vgimport ?

# vgcfgrestore -ll  -n hxvg01  -t -v
vgcfgrestore -- locking logical volume manager
vgcfgrestore -- restoring volume group "hxvg01" from
"/etc/lvmconf/hxvg01.conf"
vgcfgrestore -- checking existence of "/etc/lvmconf/hxvg01.conf"
vgcfgrestore -- reading volume group data for "hxvg01" from
"/etc/lvmconf/hxvg01.conf"
vgcfgrestore -- reading physical volume data for "hxvg01" from
"/etc/lvmconf/hxvg01.conf"
vgcfgrestore -- reading logical volume data for "hxvg01" from
"/etc/lvmconf/hxvg01.conf"
vgcfgrestore -- checking volume group consistency of "hxvg01"
vgcfgrestore -- checking volume group consistency of "hxvg01"
vgcfgrestore -- backup of volume group "hxvg01"  is consistent
--- Volume group ---
VG Name               hxvg01
VG Access             read/write
VG Status             NOT available/resizable
VG #                  0
MAX LV                256
Cur LV                2
Open LV               0
MAX LV Size           255.99 GB
Max PV                256
Cur PV                3
Act PV                3
VG Size               160.53 GB
PE Size               4.00 MB
Total PE              41096
Alloc PE / Size       41075 / 160.45 GB
Free  PE / Size       21 / 84.00 MB
VG UUID               cXz5yh-KTaG-XRxy-v30t-ajxu-dV2W-Bpu1W0

--- Logical volume ---

LV Name                /dev/hxvg01/hxlv01
VG Name                hxvg01
LV Write Access        read/write
LV Status              NOT available
LV #                   1
# open                 0
LV Size                83.85 GB
Current LE             21465
Allocated LE           21465
Allocation             next free
Read ahead sectors     128
Block device           58:0

--- Logical volume ---

LV Name                /dev/hxvg01/hxlv02
VG Name                hxvg01
LV Write Access        read/write
LV Status              NOT available
LV #                   2
# open                 0
LV Size                76.60 GB
Current LE             19610
Allocated LE           19610
Allocation             next free
Read ahead sectors     120
Block device           58:1

--- Physical volume ---

PV Name               /dev/hdd1
VG Name               hxvg01
PV Size               41.93 GB / NOT usable 3.49 MB [LVM: 271.00 KB]
PV#                   1
PV Status             available
Allocatable           yes (but full)
Cur LV                1
PE Size (KByte)       4096
Total PE              10732
Free PE               0
Allocated PE          10732
PV UUID               5SaSBe-zk7g-3XR6-5X7a-H21x-3mW4-EJyHHN

--- Physical volume ---

PV Name               /dev/hdc1
VG Name               hxvg01
PV Size               41.93 GB / NOT usable 2.96 MB [LVM: 271.00 KB]
PV#                   2
PV Status             available
Allocatable           yes (but full)
Cur LV                1
PE Size (KByte)       4096
Total PE              10733
Free PE               0
Allocated PE          10733
PV UUID               gQYeny-bpfF-IoQl-8dtG-867E-OXIj-FBqmlj

--- Physical volume ---

PV Name               /dev/hdb1
VG Name               hxvg01
PV Size               76.69 GB / NOT usable 4.64 MB [LVM: 308.00 KB]
PV#                   3
PV Status             NOT available
Allocatable           yes
Cur LV                1
PE Size (KByte)       4096
Total PE              19631
Free PE               21
Allocated PE          19610
PV UUID               3cQksh-0OAA-ar9H-3fms-AgGQ-tOIO-eREM8v

vgcfgrestore -- unlocking logical volume manager

Which of the pv* vg* lv* commands are changing the physical volume (=which are dangerous for me) ?

// melle

Signature · 2 lines
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr f�r 1 ct/ Min. surfen!
#1 lore raw
Quoted 7 lines · Thomas Mellenthin

Hello,

does anyone of you know, whether it is possible to restore an LVM just from the physical volumes and the VG.conf file ?

I did an update from Kernel 2.4.10 (SuSE 7.3) to 2.4.19 (SuSE 8.1) with the result that no volume groups are found :-(

Under SuSE 8.1:

- what does vgscan display ?
- what does pvscan display ? Does it show your PVs on hd[cd]1 ?

Quoted 6 lines

My LVM structure is like this:
The only volume group is "hxvg01" which contains two volumes "hxlv01" (pv: hdc1, hdd1) and "hxlv02" (pv: hdb1)

I tried to use vgcfgrestore (@SuSE 8.1), but it failed with this messages:

No need to vgcfgrestore, because your metadata should still be on hd[cd]1, unless you (or yast) write somethig onto hd[cd]1. You didn't create filesystems during the update ther, did you ? ;) If you did -> full stop. No chance to retrieve anything particular usefull from the PVs again.

Key question is as asked above:
does pvscan (SuSE 8.1) find your 2 PVs on hd[cd]1 ?

Regards,
Heinz -- The LVM Guy --

Quoted 125 lines

vgcfgrestore -- INFO: using backup file "/etc/lvmconf/hxvg01.conf" vgcfgrestore -- ERROR: different structure size stored in "/etc/lvmconf/hxvg01.conf" than expected in file vg_cfgrestore.c [line 139] vgcfgrestore -- ERROR "vg_cfgrestore(): read" restoring volume group "hxvg01"

Is this the often discussed "compatibility problem" ? How can I safe migrate to
the new LVM Version without loosing all my data OR (if it is not possible) how
can I access my LVM on a Linux 2.4.10 System ?

The vgcfgrestore-step taken on a minimal Linux (SuSE 7.3) with Kernel 2.4.10 shows that
following result. Which steps are necessary to access my volumes under Kernel 2.4.10 ?
Is it possible to import the VG using the -f parameter of vgimport ?

# vgcfgrestore -ll  -n hxvg01  -t -v
vgcfgrestore -- locking logical volume manager
vgcfgrestore -- restoring volume group "hxvg01" from
"/etc/lvmconf/hxvg01.conf"
vgcfgrestore -- checking existence of "/etc/lvmconf/hxvg01.conf"
vgcfgrestore -- reading volume group data for "hxvg01" from
"/etc/lvmconf/hxvg01.conf"
vgcfgrestore -- reading physical volume data for "hxvg01" from
"/etc/lvmconf/hxvg01.conf"
vgcfgrestore -- reading logical volume data for "hxvg01" from
"/etc/lvmconf/hxvg01.conf"
vgcfgrestore -- checking volume group consistency of "hxvg01"
vgcfgrestore -- checking volume group consistency of "hxvg01"
vgcfgrestore -- backup of volume group "hxvg01"  is consistent
--- Volume group ---
VG Name               hxvg01
VG Access             read/write
VG Status             NOT available/resizable
VG #                  0
MAX LV                256
Cur LV                2
Open LV               0
MAX LV Size           255.99 GB
Max PV                256
Cur PV                3
Act PV                3
VG Size               160.53 GB
PE Size               4.00 MB
Total PE              41096
Alloc PE / Size       41075 / 160.45 GB
Free  PE / Size       21 / 84.00 MB
VG UUID               cXz5yh-KTaG-XRxy-v30t-ajxu-dV2W-Bpu1W0

--- Logical volume ---

LV Name                /dev/hxvg01/hxlv01
VG Name                hxvg01
LV Write Access        read/write
LV Status              NOT available
LV #                   1
# open                 0
LV Size                83.85 GB
Current LE             21465
Allocated LE           21465
Allocation             next free
Read ahead sectors     128
Block device           58:0

--- Logical volume ---

LV Name                /dev/hxvg01/hxlv02
VG Name                hxvg01
LV Write Access        read/write
LV Status              NOT available
LV #                   2
# open                 0
LV Size                76.60 GB
Current LE             19610
Allocated LE           19610
Allocation             next free
Read ahead sectors     120
Block device           58:1

--- Physical volume ---

PV Name               /dev/hdd1
VG Name               hxvg01
PV Size               41.93 GB / NOT usable 3.49 MB [LVM: 271.00 KB]
PV#                   1
PV Status             available
Allocatable           yes (but full)
Cur LV                1
PE Size (KByte)       4096
Total PE              10732
Free PE               0
Allocated PE          10732
PV UUID               5SaSBe-zk7g-3XR6-5X7a-H21x-3mW4-EJyHHN

--- Physical volume ---

PV Name               /dev/hdc1
VG Name               hxvg01
PV Size               41.93 GB / NOT usable 2.96 MB [LVM: 271.00 KB]
PV#                   2
PV Status             available
Allocatable           yes (but full)
Cur LV                1
PE Size (KByte)       4096
Total PE              10733
Free PE               0
Allocated PE          10733
PV UUID               gQYeny-bpfF-IoQl-8dtG-867E-OXIj-FBqmlj

--- Physical volume ---

PV Name               /dev/hdb1
VG Name               hxvg01
PV Size               76.69 GB / NOT usable 4.64 MB [LVM: 308.00 KB]
PV#                   3
PV Status             NOT available
Allocatable           yes
Cur LV                1
PE Size (KByte)       4096
Total PE              19631
Free PE               21
Allocated PE          19610
PV UUID               3cQksh-0OAA-ar9H-3fms-AgGQ-tOIO-eREM8v
Quoted 17 lines

vgcfgrestore -- unlocking logical volume manager

Which of the pv* vg* lv* commands are changing the physical volume (=which are dangerous for me) ?

// melle

Signature · 9 lines
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!


_______________________________________________
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

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

#2 lore raw

Hello,

Quoted 2 lines

Under SuSE 8.1:
- what does vgscan display ?

router:/home/melle # vgscan
vgscan -- reading all physical volumes (this may take a while...) vgscan -- ERROR "vg_read_with_pv_and_lv(): current PV" can't get data of volume group "hxvg01" from physical volume(s)
vgscan -- "/etc/lvmtab" and "/etc/lvmtab.d" successfully created vgscan -- WARNING: This program does not do a VGDA backup of your volume group

Quoted 1 line

- what does pvscan display ? Does it show your PVs on hd[cd]1 ?

router:/home/melle # pvscan
pvscan -- reading all physical volumes (this may take a while...) pvscan -- inactive PV "/dev/hdc1" is associated to unknown VG "hxvg01" (run vgscan)pvscan -- inactive PV "/dev/hdd1" is in no VG [41.93 GB] pvscan -- inactive PV "/dev/hdb1" is associated to unknown VG "hxvg01" (run vgscan)pvscan -- total: 3 [160.54 GB] / in use: 2 [118.62 GB] / in no VG: 1 [41.93 GB]

Quoted 3 lines

No need to vgcfgrestore, because your metadata should still be on hd[cd]1 unless you (or yast) write somethig onto hd[cd]1. You didn't create files systems during the update ther, did you ? ;)

uhm... no. But I created a logical volume on a new VG (I thought it's just a naming problem and tried to create VG and LV with the same names. Mounting the file system failed and I stopped any 'experimental' actions). So the filesystem should be ok, but the metadata on the PV is somehow damaged.

I guess that the job is to force the assignemt of /dev/hdd1 to VG "hxvg01" and to make this VG 'known' to the LVM and activate the PVs.
I'm a bit lost know, because I don't know how to 'write back' these information from the hxvg01.conf file to the PVs.

Any help would be deeply appreciated.

// melle

#3 lore raw
Quoted 28 lines · Thomas Mellenthin

Hello,

Quoted 2 lines

Under SuSE 8.1:
- what does vgscan display ?

router:/home/melle # vgscan
vgscan -- reading all physical volumes (this may take a while...) vgscan -- ERROR "vg_read_with_pv_and_lv(): current PV" can't get data of volume group "hxvg01" from physical volume(s)
vgscan -- "/etc/lvmtab" and "/etc/lvmtab.d" successfully created vgscan -- WARNING: This program does not do a VGDA backup of your volume group

Quoted 1 line

- what does pvscan display ? Does it show your PVs on hd[cd]1 ?

router:/home/melle # pvscan
pvscan -- reading all physical volumes (this may take a while...) pvscan -- inactive PV "/dev/hdc1" is associated to unknown VG "hxvg01" (run vgscan)pvscan -- inactive PV "/dev/hdd1" is in no VG [41.93 GB] pvscan -- inactive PV "/dev/hdb1" is associated to unknown VG "hxvg01" (run vgscan)pvscan -- total: 3 [160.54 GB] / in use: 2 [118.62 GB] / in no VG: 1 [41.93 GB]

Quoted 3 lines

No need to vgcfgrestore, because your metadata should still be on hd[cd]1 unless you (or yast) write somethig onto hd[cd]1. You didn't create files systems during the update ther, did you ? ;)

uhm... no. But I created a logical volume on a new VG (I thought it's just a naming problem and tried to create VG and LV with the same names. Mounting the file system failed and I stopped any 'experimental' actions). So the filesystem should be ok, but the metadata on the PV is somehow damaged.

Quoted 7 lines

I guess that the job is to force the assignemt of /dev/hdd1 to VG "hxvg01" and to make this VG 'known' to the LVM and activate the PVs.
I'm a bit lost know, because I don't know how to 'write back' these information from the hxvg01.conf file to the PVs.

Any help would be deeply appreciated.

Thomas,
please send the output file named Thomas.Mellenthin.vgda.tar.bz2 of

for d in hd[b-d]1

	dd if=/dev/$d of=$d.vgda bs=1k count=4k

done
tar cvf - hd[b-d]1.vgda | bzip2 > Thomas.Mellenthin.vgda.tar.bz2 rm hd[b-d]1.vgda

to me in private email ([email protected]) for further investigation.

Quoted 12 lines

// melle

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