Operating System - HP-UX
1836579 Members
1892 Online
110102 Solutions
New Discussion

old LVM data structures exist

 
SOLVED
Go to solution
John Ferrara
Frequent Advisor

old LVM data structures exist

Please help:

I was about to add a disk to a VG when a msg popped up telling me there was old LVM data structures on the disk. How can I check what data in on this disk?

John
It was working fine when I left....what did you do?
11 REPLIES 11
A. Clay Stephenson
Acclaimed Contributor

Re: old LVM data structures exist

Do a pvdisplay -v.

Man pvdisplay for details. This is fairly typical if you are reuseing a disk. In that case, you specify the -f option when using pvcreate to force it yo reuse the disk BUT be sure that you don't need the existing data.
If it ain't broke, I can fix that.
Helen French
Honored Contributor

Re: old LVM data structures exist

Hi John,

First of all try a 'pvdisplay -v /dev/dsk/cxtydz'

If it gives error, then you can try 'vgscan' on the disk and if it reports any LVM structure, then use 'vgimport' command.

# mkdir /dev/vg_new
# mknod /dev/vg_new/group c 64 0x0?0000
# vgimport /dev/vg_new /dev/dsk/cxtydz
# vgchange -a y /dev/vg_new
# vgdisplay -v /dev/vg_new

Then make mount points and mount the LVs if needed.

If you don't require any data from the disk, use '-f' option with 'pvcreate' ( forcefully creating pv)

HTH,
Shiju
Life is a promise, fulfill it!
Bill McNAMARA_1
Honored Contributor
Solution

Re: old LVM data structures exist

Either you are adding the wrong disk into your vg or you disk has been previously used.

If the wrong disk:
verify via leds:

dd if=/dev/dsk/cXtYd0 of=/dev/null

for a read to null
(careful of the if,of!)
Then look for leds.

If you're sure it's the disk you want, verify it's not in any other vg via

strings /etc/lvmtab

If not there,
pvcreate -f /dev/dsk/cXtYd0

to reinit it for lvm use.

If it is there and you're sure you want to use it,

vgreduce vgXYZ /dev/dsk/cXtYd0

and hopefully it'll work if there's no lv data on the disk. If there is, use pvmove to move the data to another disk before reducing.

Later,
Bill
It works for me (tm)
John Ferrara
Frequent Advisor

Re: old LVM data structures exist

Shiju,

When I run vgscan I get the following msg:

Following Physical Volumes belong to one Volume Group.
Unable to match these Physical Volumes to a Volume Group.
Use the vgimport command to complete the process.
/dev/dsk/c2t9d0

I don't want to lose the data on the disk if this disk is supposed to belong to an existing VG, I just want to know what it is. If it is not needed, I'll just overwrite it.

John
It was working fine when I left....what did you do?
Helen French
Honored Contributor

Re: old LVM data structures exist

Hi John,

You can do 'vgimport' on this disk and see what it has. Follow the steps I have given before. Give a new VG name ( vg05 ? ) by checking your current vg information.

HTH,
Shiju
Life is a promise, fulfill it!
John Ferrara
Frequent Advisor

Re: old LVM data structures exist

Shiju,

As per your instructions, when I do vgimport, I get:

Volume group "/dev/vg99" is still active

Then, when I do vgchange:

vgchange: Volume group "/dev/vg99" does not exist in the "/etc/lvmtab" file.

Then, when I do vgdisplay:

vgdisplay: Volume group "/dev/vg99" does not exist in the "/etc/lvmtab" file.
vgdisplay: Cannot display volume group "/dev/vg99".

Am I doing something wrong????

John
It was working fine when I left....what did you do?
Helen French
Honored Contributor

Re: old LVM data structures exist

Hi John,

As an eg: I will assume your HDD is /dev/dsk/c6t1d0 and the new vg name is - vg09. Then:

# mkdir /dev/vg09
# cd /dev/vg09
# mknod group c 64 0x090000
# vgimport /dev/vg09 /dev/dsk/c6t1d0
# vgchange -a y /dev/vg09
# vgdisplay -v /dev/vg09
# mkdir /test1
# mount /dev/vg09/lvol1 /test1 (repeat these steps for all lvols )

HTH,
Shiju
Life is a promise, fulfill it!
John Ferrara
Frequent Advisor

Re: old LVM data structures exist

Shiju,

I still get the same results. I'm just going to use it in an existing VG. If there was important data on there, someone would have complaimed about it by now. Thanks for your help.

John
It was working fine when I left....what did you do?
Helen French
Honored Contributor

Re: old LVM data structures exist

Hi John,

R u sure that you are using a new name for the VG ? Can you post the output of 'strings /etc/lvmtab' ? Does 'pvdisplay' gave some error ?

If the LVM data area is currupted on the disk, then you may experience difficulties importing it.

HTH,
Shiju
Life is a promise, fulfill it!
harry d brown jr
Honored Contributor

Re: old LVM data structures exist

Just make sure you aren't using an alternate path to a device - that would be one big no no.

live free or die
harry
Live Free or Die
Bill McNAMARA_1
Honored Contributor

Re: old LVM data structures exist

This is a really nasty problem with lvm..

I think the only way to repair it is to bootin into lvm maintenance mode and recreate the lvmtab.

What is happening is that the disk is out of whack with the os config.

I'd call your RCE to work this one out.

It's usually caused after doing a vgscan after a dd of one disk to another...
PVRA, VGRA is duplicated, ie host sees 2 disks that lvm thinks is one. (or something like that!)


Later,
Bill
It works for me (tm)