1832978 Members
2970 Online
110048 Solutions
New Discussion

Re: where PV and VG

 
SOLVED
Go to solution
bernard_4
Occasional Advisor

where PV and VG

Hi all:

I'm trying to clean up my storage.. got a xp with many luns.. i've a list of them.. i'm trying to figure out who's using what disk..

1) I've compared dsh strings to lvmtab (nothing returns regarding a particular disk)
2) vgdisplay output
(no vg using that disk)

all my vgs are accounted for..

yet when i try to pvcreate ... it says pv already in a VG..

is there a command where i can query the disk (diskinfo doesn't help) .. to see what lv are on it or better still which VG it belongs too..

any suggestiong appreciated..

thanks
B.


6 REPLIES 6
Byron Myers
Trusted Contributor

Re: where PV and VG

Bernard, If a "vgexport" was done, then when you try to pvcreate on a disk that was in the exported VG, then you will get the message you are seeing. This is to protect exported VG's. If you're absolutely sure that the disk you are trying to "pvcreate" is not actually used, then use the force option of pvcreate "pvcreate -f /dev/dsk/
If you can focus your eyes far and straight enough ahead of yourself, you can see the back of your head.
Patrick Wallek
Honored Contributor

Re: where PV and VG

You can try doing a 'pvdisplay -v /dev/dsk/c#t#d#' and see what it returns. I believe it returns an error if the disk does not belong to a VG.
bernard_4
Occasional Advisor

Re: where PV and VG

Byron:
I have exported VGs.. but they are imported back on another node.. so in other words.. a VG has to reside somewhere in an active stage.. and i've taken VG outputs from all my machines.. but i definately see your point...i'll make sure I didn't miss out any renegade VGs...

Mike:
yes.. mike... it failed when I tried to use pvdisplay ...

Guys thanks for your time.. if u do have other suggestions please keep 'em coming..
bernard_4
Occasional Advisor

Re: where PV and VG

Sorry Patrick.. it was you i was trying to address in the earlier reply.. where did Mike come from?

Bruce Regittko_1
Esteemed Contributor
Solution

Re: where PV and VG

Hi,

The pvcreate command will reserve about 400K (2900K for a boot disk) of space on the disk for use with LVM. If it detects that these structures already exist then pvcreate will fail with the message that the disk already belongs to a VG. It doesn't, however, actually look at what is in the structures and in /etc/lvmtab to see if the disk is actually in a VG. If the disk used to be in a VG but currently is not, pvcreate will still fail.

If you use "force" option, pvcreate -f, then the command takes a more detailed look to determine if the disk is in a VG. One thing to note, is that if you use pvcreate -f and the disk is in a VG, the command will still fail. Otherwise, it should succeed.

--Bruce
www.stratech.com/training
bernard_4
Occasional Advisor

Re: where PV and VG

Bruce:

thanks for the explanation.. think the combination of your explanation plus other inputs from Byron and Patrick got this resolved.. thanks to all ... really appreciate the time..