Cleanup and Delete old Volume Groups
Are you cleaning up an old volume group and want to ensure that your delete the volume group and PVID to avoid any possible risk of it accidentally being reused? You need to use reducevg to delete a volume group, as exportvg just removed the volume group definition for the ODM.
Here are the steps to remove a volume group.
List the current disks and volume groups.
lspv
NAME PVID VG STATUS
hdisk0 0012345678901234 rootvg active
hdisk1 none None
hdisk2 none None
hdisk3 0012345678905678 osimagevg active
List an logical volumes in the volume group.
lsvg -l osimagevg
Should return no logical volumes. If there are any Logical Volumes, you must delete these first with rmlv and/or rmfs.
Reduce the volume group by its member disks.
reducevg osimagevg hdisk3
ldeletepv: Volume Group deleted since it contains no physical volumes.
Clear the PVID from the disk.
chdev -a pv=clear -l hdisk2
Confirm the volume group has gone.
lspv
NAME PVID VG STATUS
hdisk0 0012345678901234 rootvg active
hdisk1 none None
hdisk2 none None
hdisk3 none None
The readvgda command confirms volume group has been deleted.
readvgda -t /dev/hdisk3
Invalid lvm_rec!