kb

Centos | Change the LVM VolumeGroup name including root partition

Steps to Change the LVM Volume Group Name

 Step1: Change Volume Group Name

[root@localhost ~]# vgrename -v OLDVGNAME NEWVGNAME

 

Step2: Update the /etc/fstab File

Change all names from OLDVGNAME to the NEWVGNAME

Step3: Update the grub2 config file /boot/grub2/grub.cfg

Change all names from OLDVGNAME to the NEWVGNAME

Example:

Before:

.
        linux   /vmlinuz-3.10.5-327.fc20.x86_64 root=/dev/mapper/OLDVGNAME-root ro rd.lvm.lv=OLDVGNAME/swap rd.lvm.lv=OLDVGNAME/root vconsole.font=latarcyrheb-sun16 crashkernel=auto systemd.unit=multi-user.target
 } echo 'Loading initial ramdisk ...' .

After:

.
        linux   /vmlinuz-3.10.5-327.fc20.x86_64 root=/dev/mapper/NEWVGNAME-root ro rd.lvm.lv=NEWVGNAME/swap rd.lvm.lv=NEWVGNAME/root vconsole.font=latarcyrheb-sun16 crashkernel=auto systemd.unit=multi-user.target
echo 'Loading initial ramdisk ...' .

Step4:Create new initram

Locate latest initramfs at /boot/initramfs-3.10.5-327.fc20.x86_64.img

[root@localhost ~]# uname -r
3.10.5-327.fc20.x86_64 
uname -r

Now create the new initram by getting their value from uname -r:

[root@localhost ~]# mkinitrd -f -v /boot/initramfs-$(uname -r).img $(uname -r)
3.10.5-327.fc20.x86_64 
mkinitrd -f -v /boot/initramfs-$(uname -r).img $(uname -r)

 

Step5: Reboot System

[root@localhost ~]# systemctl reboot
systemctl reboot

Source: http://wiki.networksecuritytoolkit.org/nstwiki/index.php/HowTo_Change_The_LVM_Volume_Group_Name_That_Includes_The_Root_Partition