How to change volume names in HP-UX (LVM)

Changing LVM logical volume names in HP-UX is extremely simple: enter into the appropriate volume group directory, and rename both the logical volume file (typically starting with lv) as well as the raw logical volume file (which normally begins with rlv). When both files are renamed appropriately, you are done.

Changing a volume group name is not as easy – not hard, just not as easy. First, you should vgexport the volume group (using the -m option to create a map):

# vgexport -m /opt/ -s vgmine

This deletes the volume group completely from LVM records and from the /dev filesystem tree. It does not, however, change data on the disk – the logical volumes and associated filesystem data are preserved.

Having done this, recreate the volume group with the new name and use vgimport:

# mkdir /dev/vgnew
# mknod /dev/vgnew/group c 64 0x070000
# vgimport -m /opt/ -s /dev/vgnew

This should then import the volume group, and give it the same logical volume names as before. Without the map, the logical volumes would still be present and accounted for and with all data preserved – but the names would be default names (lvol1, lvol2, etc.).

2 thoughts on “How to change volume names in HP-UX (LVM)”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: