I have on occasion wanted to change the name of an LVM volume group (vg) name. This is not so hard, but if the logical volumes are mounted as system filesystems (/ /var /usr etc) then it’s a bit more trouble. The following was performed on a Redhat Enterprise Linux 5.4 server, but similar steps could be followed on other systems
If the logical volumes could just be deactivated then ‘vgrename’ could be run on the live system. Since / (or /var, /usr) cannot just be unmounted the system has to be rebooted in rescue mode. The first install disk of RHEL will allow you to do this. Make sure that you tell it not to detect any installs of RHEL so that the LVM stuff is not activated. Once you get a shell prompt verify that the volume group is detected (vgscan) and that none of it’s logical volumes are active (lvscan). vgrename can now be run:
vgrename <current vg name> <new vg name>
Before rebooting a little cleanup needs to be done. Entries in /etc/fstab have to be changed to reflect the new volume group name and a new initial ramdisk has to be created. The easisest way to do this is to reboot into rescue mode and let it detect the install of your RHEL system. Once the shell comes up chroot into the mounted root (assuming the RHEL install was detected). This should be:
chroot /mnt/sysinstall
Now edit /etc/fstab. Then run:
mkinitrd –fstab=/etc/fstab <image name> <kernel version>
You should also edit your grub menu.ls to reflect the new name of the volume group that the root file systems is in.
That’s it! Now reboot and the new volume group name will be in effect.