Tuesday, January 29, 2013

How to change Volume Group's name...

In default installation of CentOS LVM is used and all volume groups are named VolGroup00. This can create problems when multiple machines' disks have to be accessed from a single machine. So, one of the options is to rename volume groups. This is actually very easy to do in the following four steps that can be done on a live machine:
  1. Rename volume group.
  2. # vgrename VolGroup00 <newname>
  3. Change /etc/fstab
  4. Open it in some text editor and do a search and replace through the file, i.e. any occurrence of VolGroup00 change to <newname>.
  5. Change /etc/boot/grub.conf
  6. Open it in some text editor and do a search and replace through the file, i.e. any occurrence of VolGroup00 change to <newname>.
  7. Recreate initrd image.
  8. First, rename old initrd image. initrd images are in /boot directory and their name contains the version of currently running kernel (use uname -r but without architecture part).
    # initrd <initrdname> <kernel version>
    Be careful that you don't have newer kernel installed which will be started during the next boot process. In that case you'll have problems! Maybe it's best to restart machine before doing this whole procedure.
Restart machine and that should be it. :) Of course, just to be safe try this first on some test machine.

No comments:

About Me

scientist, consultant, security specialist, networking guy, system administrator, philosopher ;)

Blog Archive