HP-UX System Administrator's Guide: Logical Volume Management (5900-3028, March 2013)

To keep /dev/disk/disk0 and /dev/disk/disk1 in vgold and split the remaining physical
volumes into a new volume group named vgnew, follow these steps:
1. Deactivate the volume group as follows:
# vgchange -a n vgold
2. Export the volume group as follows:
# vgexport vgold
3. Change the VGID on the physical volumes to be assigned to the new volume group as follows:
# vgchgid -f /dev/rdisk/disk2 /dev/rdisk/disk3 \
/dev/rdisk/disk4 /dev/rdisk/disk5
4. If you are using an HP-UX release before March 2008, or if you want to specify the minor
number of the vgold group file, create it using the procedure in “Creating the Volume Group
Device File” (page 44).
5. If you are using an HP-UX release before March 2008, or if you want to specify the minor
number of the vgnew group file, create it using the procedure in “Creating the Volume Group
Device File” (page 44).
6. Import the physical volumes in the old volume group as follows:
# vgimport /dev/vgold /dev/rdisk/disk0 /dev/rdisk/disk1
7. Import the physical volumes in the new volume group as follows:
# vgimport /dev/vgnew /dev/rdisk/disk2 /dev/rdisk/disk3 \
/dev/rdisk/disk4 /dev/rdisk/disk5
8. Activate the volume groups. Disable quorum checks for the old volume group (it is missing
over half its disks) as follows:
# vgchange -a y -q n /dev/vgold
# vgchange -a y /dev/vgnew
9. The logical volumes are currently defined in both volume groups. Remove the duplicate logical
volumes from the volume group that no longer contains them as follows:
# lvremove -f vgold/lvol4 vgold/lvol5 vgold/lvol6
# lvremove -f vgnew/lvol1 vgnew/lvol2 vgnew/lvol3
10. The physical volumes are currently defined in both volume groups. Remove the missing physical
volumes from both volume groups as follows:
# vgreduce -f vgold
# vgreduce -f vgnew
11. Enable quorum checks for the old volume group as follows:
# vgchange -a y -q y /dev/vgold
On completion, the original volume group contains three logical volumes (lvol1, lvol2, and
lvol3) with physical volumes /dev/disk/disk0 and /dev/disk/disk1. The new volume
group vgnew contains three logical volumes (lvol4, lvol5, and lvol6) across physical volumes
/dev/disk/disk2, /dev/disk/disk3, /dev/disk/disk4, and /dev/disk/disk5.
Removing a Volume Group
TIP: It is easier to export a volume group than to remove it, because removing the volume group
requires that you remove all the logical volumes and physical volumes from the volume group
before running vgremove. In addition, exporting the volume group leaves the LVM information
on the disks untouched, which is an advantage if you want to reimport the volume group later. For
the procedure to export a volume group, see “Exporting a Volume Group” (page 57).
To remove a volume group, follow these steps:
1. Back up all user data.
Common LVM Tasks 67