12-02-2013 03:06 AM
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.
Solved! Go to Solution.
12-02-2013 03:28 AM - edited 12-02-2013 03:29 AM
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
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! star in the left column!
12-02-2013 10:56 AM
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.