• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

CentOS / RHEL 6 : How to Change the Volume Group Name for Root Disk Device

by admin

The post describes the renaming of the volume group (vg) being used for the root file system. For example purpose we will be renaming the disk group from vg_old to vg_new.

Steps

1. Rename the Volume Group from vg_old to vg_new :

# vgs
  VG         #PV #LV #SN Attr   VSize VFree
  vg_old   1   2   0 wz--n- 7.88G    0
# vgrename  vg_old vg_new
  Volume group "vg_old" successfully renamed to "vg_new"
# vgs
  VG            #PV #LV #SN Attr   VSize VFree
  vg_new   1   2   0 wz--n- 7.88G    0

2. Replace references to the old VG name ( vg_old ) with the new VG name ( vg_new ) in the files /etc/fstab and /boot/grub/grub.conf. I have changed the 2 references (for swap and root filesystem) with the new disk group name vg_new (highlighted).

# cat /etc/fstab
/dev/mapper/vg_new-lv_root    /                       ext4    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/mapper/vg_new-lv_swap    swap                    swap    defaults        0 0

Similarly do the changes in /boot/grub/grub.conf :

# cat /boot/grub/grub.conf
...
	kernel /vmlinuz-2.6.32-642.1.1.el6.x86_64 ro root=/dev/mapper/vg_new-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg_new/lv_root rd_NO_MD rd_LVM_LV=vg_new/lv_swap SYSFONT=latarcyrheb-sun16 crashkernel=auto  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
...

3. Create a New Ramdisk Image:
Run the following commands to make a new initial ramdisk image. It is recommended you make a backup copy of the initrd in case the new version has an unexpected problem:

# cp /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak

Now rebuild the initramfs for the current kernel version:

# dracut -f

4. Reboot the server.

# shutdown -r now

Filed Under: Linux

Some more articles you might also be interested in …

  1. pi: command not found
  2. iperf: command not found
  3. keyctl Command Examples in Linux
  4. check-support-status: Command Examples in Linux
  5. How to uninstall ssh software package from Ubuntu
  6. rtorrent Command Examples in Linux
  7. faillock: command not found
  8. ldd: command not found
  9. Linux OS Service ‘haldaemon’
  10. kubeadm Command Examples

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright