Changing the Volume Group Name
- Apr
- 15
- Posted by TKH Specialist
- Posted in LVM, redhat
One of the problems with cloning a system is that it has the same volume group names as the server it was cloned from. Not a huge problem but it can limit your ability to leverage the volume group. The fix appears easy but there is a gotcha.
RedHat provides a nice utility: vgrename
If you use that command and think you are done, you will be sorely mistaken if your root file system is on a volume group! I’m speaking from experience there, so listen up!
If you issue the vgrename command:
# vgrename OldVG_Name NewVG_Name
it works like a charm. If you happen to reboot your system at this point you are in big trouble… The system will Kernel Panic.
If you updated/changed the name of the VG that contains the root file system you need to modify the following two files to reflect the NewVG_Name.
- In /etc/fstab. This one is obvious and I usually remember.
- In /etc/grub.conf. Otherwise the kernel tries to mount the root file-system using the old volume group name.
The change is easy using ‘vi’. Open the file in vi, then use sed from within vi; for example:
vi /etc/fstab :%s/OldVG_Name/NewVG_Name/g :wq
Don’t forget to save the changes.
Recent Comments
- Stefan on Flush This!
- Timestamping your Bash History | Matt's Entropy on Remember when you issued that command…?
- Matt Smith on Remember when you issued that command…?
- Ruan on Putting ‘lsof’ to use
- Dylan F. Marquis on External Mapping of LDAP attributes in CAS