Skip to contentSkip to conversation

VG lost, no lvmconf => Help !

linux-lvm Guillaume Duquesnay 2 participants 6 messages Jan 23, 2002 – Jan 25, 2002

lore
Share & tools
lore
#0 lore raw

Here's my startup config :
on a single SCSI disk :
- linux 2.4.17 was booting on an lvm partiton, VG main, with LV : root, usr, boot, and var.
- an old linux system, 2.4.17 also, but classical ext2-based.

The LVM linux system was created by copying the root partitions of the ext2 system (as described in the LVM doc). Everything was working great with the LVM-based system, but i kept the old ext2 system as a rescue linux. Then, I did a vgextend to a remaining PV to my VG, and it boot and works already.

Problems arrived when i tried to add a SCSI CD burner : lvm didn't find the PVs, nor the VG, causing a kernel panic at boot time, and so did the ext2 linux. I was unable to fix that problem (SCSI id checked, ...), i removed that SCSI device, and then only the ext2 system did boot again. My vg was no longer detected.

So, here's where i am : under the ext2 system, i have no lvmtab for my VG, neither a recent main.conf, and my vg is no more detected, so i cannot recover my vg with vgcfgrestore. I did scan the 2 LVM PVs, and they are ok. So my question is :
is there a way to recover my VG with the datas contained in the PVs ?

info :

The system is a Linux-2.4.17 based kernel, with lvm-1.0.1-1

Here's my log :

////////------pvscan-------

# pvscan
pvscan -- reading all physical volumes (this may take a while...)
pvscan -- inactive PV "/dev/sda1"  is associated to an unknown VG (run vgscan)
pvscan -- inactive PV "/dev/sda3"  is associated to an unknown VG (run vgscan)
pvscan -- total: 2 [5.39 GB] / in use: 2 [5.39 GB] / in no VG: 0 [0]

///////------lvmdiskscan-------
-]# lvmdiskscan
lvmdiskscan -- reading all disks / partitions (this may take a while...)

lvmdiskscan -- /dev/sda1 [       3.99 GB] Primary  LVM partition [0x8E]
lvmdiskscan -- /dev/sda2 [       2.60 GB] Primary  LINUX native partition [0x83]lvmdiskscan -- /dev/sda3 [       1.39 GB] Primary  LVM partition [0x8E]
lvmdiskscan -- /dev/sda4 [     494.19 MB] Primary  LINUX swap partition [0x82]

lvmdiskscan -- 1 disk
lvmdiskscan -- 0 whole disks
lvmdiskscan -- 0 loop devices
lvmdiskscan -- 0 multiple devices
lvmdiskscan -- 0 network block devices
lvmdiskscan -- 4 partitions
lvmdiskscan -- 2 LVM physical volume partitions

///////------vgscan--------
]# vgscan
vgscan -- reading all physical volumes (this may take a while...) vgscan -- "/etc/lvmtab" and "/etc/lvmtab.d" successfully created vgscan -- WARNING: This program does not do a VGDA backup of your volume group

///////------vgdisplay-----
]# vgdisplay
vgdisplay -- no volume groups found

///////------pvdata-------
]# pvdata -v -V -L /dev/sda1 | grep -v empty
--- Volume group ---
VG Name

VG Access             read/write
VG Status             NOT available/resizable
VG #                  0
MAX LV                256
Cur LV                4
Open LV               0
MAX LV Size           255.99 GB
Max PV                256
Cur PV                2
Act PV                2
VG Size               5.38 GB
PE Size               4.00 MB
Total PE              1376
Alloc PE / Size       1277 / 4.99 GB
Free  PE / Size       99 / 396.00 MB
VG UUID               ML3C0g-bpt6-2He5-AK6f-5DNt-2LVV-bEm05U

--- List of logical volumes ---

--- Logical volume ---

LV Name                /dev/main/boot
VG Name                main
LV Write Access        read/write
LV Status              NOT available
LV #                   1
# open                 0
LV Size                40.00 MB
Current LE             10
Allocated LE           10
Allocation             next free
Read ahead sectors     120
Block device           58:0

read_ahead: 120

--- Logical volume ---

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

read_ahead: 120

--- Logical volume ---

LV Name                /dev/main/usr
VG Name                main
LV Write Access        read/write
LV Status              NOT available
LV #                   3
# open                 0
LV Size                3.00 GB
Current LE             768
Allocated LE           768
Allocation             next free
Read ahead sectors     120
Block device           58:2

read_ahead: 120

--- Logical volume ---

LV Name                /dev/main/var
VG Name                main
LV Write Access        read/write
LV Status              NOT available
LV #                   4
# open                 0
LV Size                972.00 MB
Current LE             243
Allocated LE           243
Allocation             next free
Read ahead sectors     120
Block device           58:3

read_ahead: 120

pvdata -- logical volume struct at offset 4 is empty
....

and i have the same for /dev/sda3

///////////----------------

So, how can i use this stuff to recreate a good VG info and make my system back ? Many thanks,

Guillaume

#1 lore raw

Can you send "vgscan -d" to me in personal email ([email protected])? What does lvm-1.0.1-1 mean. We don't have such version. Please check with for eg. "vgdisplay -h".

Quoted 35 lines · Guillaume Duquesnay

Here's my startup config :
on a single SCSI disk :
- linux 2.4.17 was booting on an lvm partiton, VG main, with LV : root, usr, boot, and var.
- an old linux system, 2.4.17 also, but classical ext2-based.

The LVM linux system was created by copying the root partitions of the ext2 system (as described in the LVM doc). Everything was working great with the LVM-based system, but i kept the old ext2 system as a rescue linux. Then, I did a vgextend to a remaining PV to my VG, and it boot and works already.

Problems arrived when i tried to add a SCSI CD burner : lvm didn't find the PVs, nor the VG, causing a kernel panic at boot time, and so did the ext2 linux. I was unable to fix that problem (SCSI id checked, ...), i removed that SCSI device, and then only the ext2 system did boot again. My vg was no longer detected.

So, here's where i am : under the ext2 system, i have no lvmtab for my VG, neither a recent main.conf, and my vg is no more detected, so i cannot recover my vg with vgcfgrestore. I did scan the 2 LVM PVs, and they are ok.
So my question is :
is there a way to recover my VG with the datas contained in the PVs ?

info :

The system is a Linux-2.4.17 based kernel, with lvm-1.0.1-1

Here's my log :

////////------pvscan-------

# pvscan
pvscan -- reading all physical volumes (this may take a while...)
pvscan -- inactive PV "/dev/sda1"  is associated to an unknown VG (run 

<SNIP>

Quoted 9 lines

Many thanks,

Guillaume

_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://www.sistina.com/lvm/Pages/howto.html

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
Quoted 1 line · Heinz J . Mauelshagen

Can you send "vgscan -d" to me in personal email ([email protected])?

OK, i'll do that.

Quoted 1 line

What does lvm-1.0.1-1 mean. We don't have such version.

In fact, 1.0.1-1-mdk (Mandrake), you can find it on rpmfind.net

Quoted 1 line

Please check with for eg. "vgdisplay -h".

---------------
vgdisplay -h
Logical Volume Manager 1.0.1
Heinz Mauelshagen, Sistina Software 26/11/2001 (IOP 10)

vgdisplay -- display volume group information

vgdisplay [-c|--colon | -s|--short | -v[v]|--verbose [--verbose]]

        [-d|--debug] [-h|--help] [--version]
        [-A|--activevolumegroups | [-D|--disk] [VolumeGroupName...] ]

---------------

A little more info :

i tried to reimport the old PVs
----------------
]# vgimport -f -v main /dev/sda1 /dev/sda3
vgimport -- locking logical volume manager
vgimport -- checking volume group name
vgimport -- checking volume group "main" existence
vgimport -- trying to read physical volumes
vgimport -- checking for duplicate physical volumes
vgimport -- checking physical volume name "/dev/sda1"
vgimport -- reading data of physical volume "/dev/sda1" from disk vgimport -- checking for exported physical volume "/dev/sda1"
vgimport -- reallocating memory
vgimport -- checking consistency of physical volume "/dev/sda1"
vgimport -- checking for duplicate physical volumes
vgimport -- checking physical volume name "/dev/sda3"
vgimport -- reading data of physical volume "/dev/sda3" from disk vgimport -- checking for exported physical volume "/dev/sda3"
vgimport -- reallocating memory
vgimport -- checking consistency of physical volume "/dev/sda3"
vgimport -- physical volumes "/dev/sda3" and "/dev/sda1" are in different volume groups

----------------

Next, i said my pvdata was identical for /dev/sda1 and /dev/sda3, but i discover that was'nt true :
---------------
#]pvdata -P /dev/sda3
--- Physical volume ---

PV Name               /dev/sda3
VG Name               main
PV Size               1.39 GB / NOT usable 7.65 MB [LVM: 125.00 KB]
PV#                   2
PV Status             NOT available
Allocatable           yes
Cur LV                1
PE Size (KByte)       4096
Total PE              355
Free PE               99
Allocated PE          256
PV UUID               none

----------------
see that PVUUID ?

So i did try uuid_fixer, which finally give me a human readable error :
----------------
]# ./uuid_fixer /dev/sda1 /dev/sda3
/dev/sda3 - UUID corrupt
----------------
Damned.
So where do we go now ?
thanks,

Guillaume

#3 lore raw
Quoted 68 lines · Guillaume Duquesnay
Quoted 1 line · Heinz J . Mauelshagen

Can you send "vgscan -d" to me in personal email ([email protected])?

OK, i'll do that.

Quoted 1 line

What does lvm-1.0.1-1 mean. We don't have such version.

In fact, 1.0.1-1-mdk (Mandrake), you can find it on rpmfind.net

Quoted 1 line

Please check with for eg. "vgdisplay -h".

---------------
vgdisplay -h
Logical Volume Manager 1.0.1
Heinz Mauelshagen, Sistina Software 26/11/2001 (IOP 10)

vgdisplay -- display volume group information

vgdisplay [-c|--colon | -s|--short | -v[v]|--verbose [--verbose]]

         [-d|--debug] [-h|--help] [--version]
         [-A|--activevolumegroups | [-D|--disk] [VolumeGroupName...] ]

---------------

A little more info :

i tried to reimport the old PVs
----------------
]# vgimport -f -v main /dev/sda1 /dev/sda3
vgimport -- locking logical volume manager
vgimport -- checking volume group name
vgimport -- checking volume group "main" existence vgimport -- trying to read physical volumes
vgimport -- checking for duplicate physical volumes vgimport -- checking physical volume name "/dev/sda1" vgimport -- reading data of physical volume "/dev/sda1" from disk vgimport -- checking for exported physical volume "/dev/sda1" vgimport -- reallocating memory
vgimport -- checking consistency of physical volume "/dev/sda1" vgimport -- checking for duplicate physical volumes vgimport -- checking physical volume name "/dev/sda3" vgimport -- reading data of physical volume "/dev/sda3" from disk vgimport -- checking for exported physical volume "/dev/sda3" vgimport -- reallocating memory
vgimport -- checking consistency of physical volume "/dev/sda3" vgimport -- physical volumes "/dev/sda3" and "/dev/sda1" are in different volume groups

----------------

Next, i said my pvdata was identical for /dev/sda1 and /dev/sda3, but i discover that was'nt true :
---------------
#]pvdata -P /dev/sda3
--- Physical volume ---

PV Name               /dev/sda3
VG Name               main
PV Size               1.39 GB / NOT usable 7.65 MB [LVM: 125.00 KB]
PV#                   2
PV Status             NOT available
Allocatable           yes
Cur LV                1
PE Size (KByte)       4096
Total PE              355
Free PE               99
Allocated PE          256
PV UUID               none
Quoted 7 lines

----------------
see that PVUUID ?

So i did try uuid_fixer, which finally give me a human readable error :
----------------
]# ./uuid_fixer /dev/sda1 /dev/sda3
/dev/sda3 - UUID corrupt

uuid_fixer aims to write a correct list of PV uuids to every PV. But it can't handle this case, where you don't have a PV UUID at all on /dev/sda3.

So, let's hack one in to hopefully make LVM happier.

First preserve the metadata on sda1 and sda3 for recovery with:

dd if=/dev/sda1 of=sda1.VGDA count=512 bs=1k
dd if=/dev/sda3 of=sda3.VGDA count=512 bs=1k

Backup sda[13].VGDA please.

echo "sahdgdgasjg21hxjn45jxJJ45aasdc3d"|dd of=/dev/sda3 obs=1 seek=44 count=32

Run

./uuid_fixer /dev/sda1 /dev/sda3

again.
Retry vgscan afterwards.

Quoted 14 lines

----------------
Damned.
So where do we go now ?
thanks,

Guillaume

_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://www.sistina.com/lvm/Pages/howto.html

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

[Re: [linux-lvm] VG lost, no lvmconf => Help ! ] Corrupted PV UUID

Quoted 9 lines · Heinz J . Mauelshagen

On Thu, Jan 24, 2002 at 04:15:27PM +0100, Guillaume Duquesnay wrote:

So, let's hack one in to hopefully make LVM happier.

First preserve the metadata on sda1 and sda3 for recovery with:

dd if=/dev/sda1 of=sda1.VGDA count=512 bs=1k dd if=/dev/sda3 of=sda3.VGDA count=512 bs=1k

done ;-)

Quoted 2 lines

Backup sda[13].VGDA please.

on a snapshoted nfs.

Quoted 4 lines

echo "sahdgdgasjg21hxjn45jxJJ45aasdc3d"|dd of=/dev/sda3 obs=1 seek=44 count=32

I didn't remember enough C to calculate this offset ;-) ! Question : is it a pure random UUID, that uuid_fixer will propagate wherever it is needed ?

Quoted 6 lines

Run

./uuid_fixer /dev/sda1 /dev/sda3

again. Retry vgscan afterwards.

uuid_fixer found the 2 PVs with their respective UUID,
when asked about writing in each file, i didn't find what it was about in the README, but i answered affirmative, and then normal termination. But vgscan missed again my VG.

Some few uuid_fixer and failing scans later, i tried "no" to the mistery question of uuid_fixer, after what vgscan find up my "main" VG.

vgchange -ay, mounting, cfgbackup, lilo, etc., everything was working like a charm ! Either did the reboot, so i'm currently running with my lvm root partition. Many thanks, many thanks, everything is fixed.

So I have only some informative question : what did uuid_fixer do, and what does the question mean ?

Guillaume

#5 lore raw

Re: [Re: [linux-lvm] VG lost, no lvmconf => Help ! ] Corrupted PV UUID

Quoted 5 lines · Guillaume Duquesnay
Quoted 3 lines · Heinz J . Mauelshagen

On Thu, Jan 24, 2002 at 04:15:27PM +0100, Guillaume Duquesnay wrote:

Quoted 8 lines
Quoted 6 lines

So, let's hack one in to hopefully make LVM happier.

First preserve the metadata on sda1 and sda3 for recovery with:

dd if=/dev/sda1 of=sda1.VGDA count=512 bs=1k dd if=/dev/sda3 of=sda3.VGDA count=512 bs=1k

done ;-)

:)

Quoted 5 lines
Quoted 3 lines

Backup sda[13].VGDA please.

on a snapshoted nfs.

Ok

Quoted 10 lines
Quoted 6 lines

echo "sahdgdgasjg21hxjn45jxJJ45aasdc3d"|dd of=/dev/sda3 obs=1 seek=44 count=32

I didn't remember enough C to calculate this offset ;-) ! Question : is it a pure random UUID, that uuid_fixer will propagate wherever it is needed ?

Well, to tell you the truth: it was my fingers running over my keyboard in a nervous coffein lack ;-)
And yes, uuid_fixer should.

Quoted 4 lines
Quoted 4 lines

Run

Quoted 8 lines
Quoted 3 lines

./uuid_fixer /dev/sda1 /dev/sda3

again. Retry vgscan afterwards.

uuid_fixer found the 2 PVs with their respective UUID,
when asked about writing in each file, i didn't find what it was about in the README, but i answered affirmative, and then normal termination. But vgscan missed again my VG.

Hmmm. Strange.
If you answer yes or use the force option it should have written the PV UUID lists to the devices correctly.

Like: "uuid_fixer -f /dev/sda[13]"

Quoted 3 lines

Some few uuid_fixer and failing scans later, i tried "no" to the mistery question of uuid_fixer, after what vgscan find up my "main" VG.

You seem to have disks which need to be convinced to take writes ;-)

Quoted 5 lines

vgchange -ay, mounting, cfgbackup, lilo, etc., everything was working like a charm ! Either did the reboot, so i'm currently running with my lvm root partition.
Many thanks, many thanks, everything is fixed.

You're welcome.

Quoted 3 lines

So I have only some informative question : what did uuid_fixer do, and what does the question mean ?

As said above:
the question comes up unless you use uuid_fixer with the "-f" option. If you answer 'y', it writes the PV UUID list back to all the devices on the command line. PV UUID lists of *all* PVs are stored on all PVs of a VG in order to identify the relationship between VG and PVs uniquely.

Quoted 9 lines

Guillaume

_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://www.sistina.com/lvm/Pages/howto.html

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