Operating System - HP-UX
1748227 Members
4535 Online
108759 Solutions
New Discussion юеВ

How can I undo a pvcreate?

 
Susan Harris
Occasional Advisor

How can I undo a pvcreate?

I have 2 disks, one being the primary and the other being the alternate link to it. I am trying to add them to a vg and I did a pvcreate on both (duh) and not just on the primary. So now the so-called 'alternate link' drive thinks he is on his own. How can I undo a pvcreate?
7 REPLIES 7
John Palmer
Honored Contributor

Re: How can I undo a pvcreate?

You can't but in this case you shouldn't need to. All that you've done is pvcreate the same disk twice.

When you add both disk paths to a Volume Group they will appear as Primary and Alternate.
Susan Harris
Occasional Advisor

Re: How can I undo a pvcreate?

I wish, but that is not the case. Doing some reading after the fact, 'it' states that the pvcreate should only be done on the primary and not the alternate (which is what I did). When doing a vgextend /dev/vgxx /dev/dsk/primary , it adds it in fine, but when I do a 'vgextend /dev/vgxx /dev/dsk/alternate', it adds it into the vg as another disk and not as the alternate of 'primary'.
John Palmer
Honored Contributor

Re: How can I undo a pvcreate?

Susan,

What order did you do things in

Did you :-
pvcreate primary
create VG including primary

then pvcreate alternate?

If so then just trash the VG and start again:-

vgchange -a n vg??
vgexport vg??

pvcreate primary
mkdir /dev/vg??
mknod... group

vgcreate your VG with primary and alternate disks specied and all should be well.

Regards,
John
John Palmer
Honored Contributor

Re: How can I undo a pvcreate?

After due consideration...

Are you absolutely sure that the two disks that are concerned are alternate links?

Your symptoms suggest to me that they are not.
John Palmer
Honored Contributor

Re: How can I undo a pvcreate?

One other point Susan is that until the disk is added to a Volume Group, both links are neither primary or alternate.

It's only when you've added both to a volume group that the first becomes primary and the second alternate. You can also switch them round by removing the primary (lternate becomes primary) then putting it back at which point it becomes the alternate.
Manju Kampli
Trusted Contributor

Re: How can I undo a pvcreate?

Susan,

I looks to me as if there were two different disks and you are trying to add them to a Volume group.

If the one disk is trying to add to a volume group from two different paths, it will get added as a alternate link by it self. If you are referring to two different disks, then you can not add them as primary and alternate links.

Please make sure the device files you are using and they refer to the same disk on different paths and try creating/extending the volume group
Never stop "LEARNING"
Carlos Fernandez Riera
Honored Contributor

Re: How can I undo a pvcreate?


First:

Primary and alternate link refers to the same disk using two hardware paths, so have you 1 disk or 2, 1 PV or 2PV?. In facts this means disk 1 is plugged by two ways.

Second:

if you have done pvcreate /dev/xx/alternate LVM can do it unless you use force (-f), because primary is into a VG yet.


3- When you do vgextend /dev/xx/alternate and LVM says your VG has two disks you must belive, so you must have two disk 2PV, and no two conections for 1 disk.


4- in order to verify if your VGs disks are the same, run smt->disk->info and see the serial number for each.

5- A way to undo a pvcreate is vgcfgrestore of a previously vgcfgbackp'd vg.


NOTE: Alternate link is a alternate path for a disk, not the path of mirror copy.
The use of disk A or B )( or mirror) is defined whe you create lvs not vgs.


unsupported