Renaming Volume Groups in Linux
What is that you say? Cloned a Linux machine and decided to rename that misnamed volume group using vgrename /dev/vg_RAWRStupidName /dev/vg_NiceName? Oh and now your rebooted without first changing your /etc/fstab and /etc/grub.conf and get a good old fashioned Kernel Panic? Well lucky you I remembered to write this down:
- When booting go into the Edit mode for Grub (Generally ESC during boot).
- Change the kernel boot parameters to reference your new VG name.
- Press Enter and then B to boot.
- Once you boot, remount the filesystem RW so you can edit it (At this point you’ve likely failed a FSCK and landed in rescue mode. If not, do 5 then skip to number 8.
- Remounting is done with mount -o remount,rw /
- Edit your /etc/fstab with the new VG name.
- Repeat step 1-3
- Edit /etc/grub.conf with your new VG name
- Breathe deep.
About the author
Brooks Garrett is a dedicated technologist who specializes in information security. Brooks has spent over 10 years implementing security programs for both the public and private sector including some of the biggest names in the Fortune 500. When he's not managing risk in the corporate environment you can find him at the local firestation where he is a volunteer firefighter.