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

Renaming a Volume Group
To change the name of a volume group, export it, then import it using the new name. For more
detailed information on how to export and import a volume group, see “Exporting a Volume Group
(page 57) and “Importing a Volume Group” (page 57).
To rename the volume group vg01 to vgdb, follow these steps:
1. Deactivate the volume group as follows:
# vgchange -a n vg01
2. If you want to retain the same minor number for the volume group, examine the volume group's
group file as follows:
# ls -l /dev/vg01/group
crw-r--r-- 1 root sys 64 0x010000 Mar 28 2004 /dev/vg01/group
For this example, the volume group major number is 64, and the minor number is 0x010000.
3. Export the volume group as follows:
# vgexport -m vg01.map vg01
4. If you are using an HP-UX release before March 2008, or if you want to specify the minor
number of the volume group device file, create it for the volume group's new name, using the
procedure in “Creating the Volume Group Device File” (page 44).
Since the group file in this example has a major number of 64 and a minor number of
0x010000, enter the following commands:
# mkdir /dev/vgdb
# mknod /dev/vgdb/group c 64 0x010000
5. Import the volume group under its new name as follows:
# vgimport -m vg01.map /dev/vgdb
6. Back up the volume group configuration information as follows:
# vgcfgbackup /dev/vgdb
7. Activate the volume group as follows:
# vgchange -a y /dev/vgdb
8. Remove saved configuration information based on the old volume group name as follows:
# rm /etc/lvmconf/vg01.conf
Note: if your volume group is Version 2.x and does not have any bootable physical volumes,
and if you have configured a new path for the configuration file using the
LVMP_CONF_PATH_NON_BOOT variable in the /etc/lvmrc file, you need to remove the
configuration file from the new path.
9. Update all references to the old name in any other files on the system. These include /etc/
fstab for mounted file systems or swap devices, and existing mapfiles from a vgexport
command.
Splitting a Volume Group
You can use the vgchgid to split an existing volume group into two or more volume groups,
provided that the physical volumes to be split are self-contained; that is, any logical volumes on
the physical volumes must be wholly contained on those physical volumes. For example, a splittable
volume group can have logical volumes 1, 2, and 3 on physical volumes 0 and 1, and logical
volumes 4, 5, and 6 on physical volumes 2, 3, 4, and 5.
In this example, volume group vgold contains physical volumes /dev/disk/disk0 through
/dev/disk/disk5. Logical volumes lvol1, lvol2, and lvol3 are on physical volumes /dev/
disk/disk0 and /dev/disk/disk1, and logical volumes lvol4, lvol5, and lvol6 are on
the remaining physical volumes.
66 Administering LVM