The default naming convention for a logical volume during an OS install will put the hostname in there (depending on the OS & options chosen). This can be useful for identifying what machine the volume group belongs to but, what if the system hostname were to change?

These instructions describe how to rename a volume group, in order to complete the renaming procedure the machine will need to be rebooted. Bear this in mind if working on a production system!

  • Rename the volume group
[stuart@asuka ~]$ sudo vgrename /dev/vg_**oldname** /dev/vg_**newname**
  • Replace the old group name with the new one in /etc/fstab
[stuart@asuka ~]$ sudo sed -i 's/**oldname**/**newname**/g' /etc/fstab
  • Replace the old group name with the new one in /boot/grub/grub.cfg (may need to update /boot/grub2/grub.cfg depending on the OS you are using)
[stuart@asuka ~]$ sudo sed -i 's/**oldname**/**newname**/g' /boot/grub/grub.cfg
  • Reboot the system and the renamed volume group will be properly mounted
[stuart@asuka ~]$ sudo /sbin/init 6