Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Showing results for 
Search instead for 
Did you mean: 

cannot pvremove a disk

Go to solution
Regular Advisor

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

Re: cannot pvremove a disk

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

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.





Bill Hassell
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. 

Bill Hassell, sysadmin