Written by James McDonald

October 2, 2013

Steps I used to rename a volume group which had the root and swap partitions on it. This was on CentOS 6.4

# display your volume groups
# make note of the name you want 
# to change
vgdisplay

# check your options
vgrename --help

# backup your fstab
cp /etc/fstab /etc/fstab-20131002

# open your fstab
vi /etc/fstab

# run a vi find and replace command
:%s/vg_apfmapx01/vg_system/g

# perform the rename
vgrename vg_apfmapx01 vg_system

# change grub.conf
vi /boot/grub/grub.conf
%s/vg_apfmapx01/vg_system/g

# reboot
shutdown -r now

Problem: On reboot I got kernel panic – not synching (this was due to forgetting to replace the old volume group name in grub.conf with the new volume group name ).

Resolution: Reboot and edit the boot command line to make it correct and then edit grub.conf to make it correct and reboot

# replace the old name "vg_apfmapx01" with 
# the new volume group name "vg_system"
title CentOS (2.6.32-358.18.1.el6.x86_64)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-358.18.1.el6.x86_64 ro root=/dev/mapper/vg_system-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD quiet SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto rd_LVM_LV=vg_system/lv_swap rd_LVM_LV=vg_system/lv_root  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM
        initrd /initramfs-2.6.32-358.18.1.el6.x86_64.img

 

 

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…

Squarespace Image Export

To gain continued access to your Squarespace website images after cancelling your subscription you have several...

MySQL 8.x GRANT ALL STATEMENT

-- CREATE CREATE USER 'tgnrestoreuser'@'localhost' IDENTIFIED BY 'AppleSauceLoveBird2024'; GRANT ALL PRIVILEGES ON...

Exetel Opt-Out of CGNAT

If your port forwards and inbound and/or outbound site-to-site VPN's have failed when switching to Exetel due to their...