Showing results for 
Search instead for 
Do you mean 

cannot pvremove a disk

SOLVED
Go to Solution
Regular Advisor

cannot pvremove a disk

Hi

 

I cannot pvremove a disk on HP-UX 11.31

 

root@****** at / =>pvremove /dev/rdisk/disk30
pvremove: The physical volume "/dev/rdisk/disk30" belongs to an exported volume group.
pvremove: Couldn't remove physical volume "/dev/rdisk/disk30".

 

I exported the vgX02 earlier.

 

root@****** at / =>vgdisplay -v vgX02
vgdisplay: Volume group "/dev/vgX02" does not exist in the "/etc/lvmtab" file.
vgdisplay: Volume group "/dev/vgX02" does not exist in the "/etc/lvmtab_p" file.

 

Any ideas?

 

Regards

 

Tariq

1 ACCEPTED SOLUTIONS
Acclaimed Contributor Acclaimed Contributor

Re: cannot pvremove a disk

[ Edited ]

From the man page:

The operation is denied if pv_path is assigned to a volume group. The
pvremove command only clears the LVM data structure on a disk if the
disk does not belong to a volume group. This avoids accidentally
removing a valid physical volume under a volume group. If the
physical volume to be removed belongs to a volume group, use the
vgremove command to first remove the volume group associated with the
physical volume.




The disk STILL belongs to an (exported) VG.

 

What do you want to do?

Creating another new VG?

Just Force pvcreate!


Hope this helps!
Regards
Torsten.

__________________________________________________

There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________

No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
3 REPLIES
Acclaimed Contributor Acclaimed Contributor

Re: cannot pvremove a disk

[ Edited ]

From the man page:

The operation is denied if pv_path is assigned to a volume group. The
pvremove command only clears the LVM data structure on a disk if the
disk does not belong to a volume group. This avoids accidentally
removing a valid physical volume under a volume group. If the
physical volume to be removed belongs to a volume group, use the
vgremove command to first remove the volume group associated with the
physical volume.




The disk STILL belongs to an (exported) VG.

 

What do you want to do?

Creating another new VG?

Just Force pvcreate!


Hope this helps!
Regards
Torsten.

__________________________________________________

There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________

No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Regular Advisor

Re: cannot pvremove a disk

Torsten

 

I googled it and did pvcreate -f.  Thanks.

 

Just wanted to completely get rid of a vg and its associated LUNs.

 

Regards

 

Tariq

Highlighted
Honored Contributor Honored Contributor

Re: cannot pvremove a disk

pvremove is a strange command. It will remove the LVM information but only if there is no LVM information indicating that it has not been assigned to a VG at some time in the past. There is no way for pvremove to tell if the PV is part of an exported VG (not currently in lvmtab or activated). The way to clear LVM information is to use pvcreate -f. Naturally, you must be very careful with pvcreate to specify the right PV. Once you use pvcreate, you can then use pvremove. The only point to using pvremove is that pvcreate makes the disk ready to be added as an LVM disk to a VG (a PVID is written in the LVMREC area), whereas pvremove writes a bunch of zeros over the LVMREC area.