Sunday, July 24

Rename a Volume Group in Red Hat Enterprise Linux (RHEL 5.6)
Note: This exercise is performed on a test VM built under VMWare workstation in Lab environment. It is therefore, advised that perform these steps on a test environment before moving to production.

Here is current name of volume group hosting root file system….
[root@linux1 ~]# vgs
  VG         #PV #LV #SN Attr   VSize  VFree
  VolGroup00   1   2   0 wz--n- 19.88G    0
[root@linux1 ~]#

Make backup copies of these two files
# cp /etc/fstab /etc/fstab.orig
# cp /boot/grub/grub.conf /boot/grub/grub.conf.orig

After update, /etc/fstab will look like ….
[root@linux1 etc]# cat fstab |grep rootvg
/dev/rootvg/LogVol00 /                          ext3    defaults        1 1
/dev/rootvg/LogVol01    swap                    swap    defaults        0 0
[root@linux1 etc]#

After update, /boot/grub/grub.conf will look like …
[root@linux1 ~]# cat /boot/grub/grub.conf |grep rootvg
#          kernel /vmlinuz-version ro root=/dev/rootvg/LogVol00
        kernel /vmlinuz-2.6.18-238.el5 ro root=/dev/rootvg/LogVol00 rhgb quiet crashkernel=128M@16M
[root@linux1 ~]#

Rename your volume group (vg)
[root@linux1 ~]# vgrename /dev/VolGroup00 /dev/rootvg
  Volume group "VolGroup00" successfully renamed to "rootvg"
[root@linux1 ~]#

Check the Kernel Level
[root@linux1 ~]# uname -r
2.6.18-238.el5
[root@linux1 ~]#

Backup and create Kernel Image

[root@linux1 ~]# cd /boot
[root@linux1 boot]# mv initrd-2.6.18-238.el5.img initrd-2.6.18-238.el5.img.backup

[root@linux1 boot]# mkinitrd -v initrd-2.6.18-238.el5.img 2.6.18-238.el5

Reboot the VM
[root@linux1 boot]# reboot
Verification after reboot
[root@linux1 ~]# vgs
  VG     #PV #LV #SN Attr   VSize  VFree
  rootvg   1   2   0 wz--n- 19.88G    0
[root@linux1 ~]#