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

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • 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. How to Convert Ext File Systems to Btrfs
  2. CentOS / RHEL : How to add a new Physical Volume to an existing Volume Group
  3. Getting “parsing errors” When Running ‘yum repolist’
  4. How to send Audit Logs to Remote Rsyslog Server in CentOS/RHEL 6,7
  5. How to Run a Script When USB Devices Is Attached or Removed Using UDEV
  6. How to manage File and Directory Permissions/Ownerships in Linux
  7. How to Customize Linux Password Expiration and Complexity Requirements
  8. Linux OS Service ‘ntpd’
  9. Why Does “netstat” Output Show Many Connections in CLOSE_WAIT Status?
  10. Changing the IPset rules from IPtables to Firewalld in CentOS/RHEL 7

You May Also Like

Primary Sidebar

Recent Posts

  • How to set the default character set in MySQL and how to propagate it in a master-master replication scenario
  • “Connection reset by peer” – error while ssh into a CentOS/RHEL system with a specific user only
  • MySQL: how to figure out which session holds which table level or global read locks
  • Recommended Configuration of the MySQL Performance Schema
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary