Re: cannot pvremove a disk (553 Views)
Regular Advisor
Posts: 198
Registered: ‎09-23-2011
Message 1 of 4 (587 Views)
Accepted Solution

cannot pvremove a disk



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?





Acclaimed Contributor
Posts: 23,930
Registered: ‎10-02-2001
Message 2 of 4 (582 Views)

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!


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
Posts: 198
Registered: ‎09-23-2011
Message 3 of 4 (572 Views)

Re: cannot pvremove a disk



I googled it and did pvcreate -f.  Thanks.


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





Honored Contributor
Posts: 14,403
Registered: ‎05-29-2000
Message 4 of 4 (553 Views)

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. 

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.