LVM VG/LV Renaming Caveat
At least in Fedora Core 6, if you rename the root filesystem volume group and/or logical volume names, there are a number of cleanup steps that must be performed.
First, back up everything. Second, do your vgrename and lvrename (or similar) commands. Then…
- edit grub.conf, pointing “root=/dev/VolGroup00/LogVol00″ lines to the name of your new device
- edit /etc/fstab in the same way
But wait! Before you reboot, you must either (a) manually edit your initial ramdisk or (b) reinstall the kernel you’re going to reboot to. This is because the name of the VG and LV are embedded within the initial ramdisk. Nice, huh?
If you choose (a), try something like this:
n=initrd-2.6.20.fc6.img cp /boot/$n /boot/$n.bak mkdir /tmp/work && cd /tmp/work gunzip -c /boot/$n | cpio -id # edit init, changing VG and LV names find . | cpio -o | gzip > /boot/$n
If you choose (b), here’s what you do:
rpm -ihv --force kernel-2.6.20.fc6.i686.rpm
LVM is incredibly powerful and flexible, but tough to work with. I really wish Fedora didn’t default to using it for new desktop installs.
Why would you want to rename the root filesystem VG though? Do you ever reference the name of the root VG in your normal travels?
Comment by jason — April 23, 2007 @ 9:28 am CDT
I just didn’t like “VolGroup00″.
Comment by adam — April 23, 2007 @ 7:13 pm CDT