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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • 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. goaccess: command not found
  2. ddcutil: command not found
  3. locale: command not found
  4. prlimit: command not found
  5. CentOS / RHEL 5,6 : How to reinstall GRUB loader from rescue mode
  6. Basic “chmod” Command examples in Linux
  7. How to Install and configure telnet in RHEL / CentOS 5,6
  8. How to use tar command under Linux
  9. libreoffice Command Examples in Linux
  10. hashcat Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • qm Command Examples in Linux
  • qm wait Command Examples in Linux
  • qm start Command Examples in Linux
  • qm snapshot Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright