Renaming an LVM volume group on Fedora 21

The Internet is awash with bad, or imprecise, advice. I wanted to rename the single LVM2 Volume Group on my Fedora 21 desktop. Problem was that the root partition was in it.

After much googling and several tries my conclusion is:

Don’t do it.

That’s right. Just leave it alone.

Any advice you might see out on the Internets is wrong, at least for anything running on the 4.0 Linux kernel with all services controlled by systemd.

Here’s what I tried:

1. Used vgrename to rename the volume. In my case from test1_fedora to fedora.

2. Searched and replaced through /etc/fstab and /boot/grub2/grub.cfg to to change test1_fedora to fedora.

3. Rebuilt the intramfs file for the active kernel using mkinitrd.

4. Rebooted.

After rebooting the system would go into fsck mode and eventually drop down into the dracut emergency shell.

Getting things working again wasn’t straightforward, partly due to my Acer C720 Chromebook’s firmware lack of support for booting Fedora 21 from a usb stick (I’ve since updated with the custom firmware created by John Lewis, resolving that issue).

What I finally had to do was boot with the Fedora 20 Live DVD, mount the LVM volumes, do a chroot and change everything back.

So what went wrong? At the moment I’m just not sure. If I had to guess I’d say it has something to do with systemd somehow retaining the old volume mappings, because everything else was changed as required. The only thing my sources on the Internet didn’t mention was systemd, because all their comments were made before systemd was integrated into the operating system.

This entry was posted in System Administration, Systems Analysis on by .

About phil

My name is Phil Lembo. In my day job I’m an enterprise IT architect for a leading distribution and services company. The rest of my time I try to maintain a semi-normal family life in the suburbs of Raleigh, NC. E-mail me at philipATlembobrothersDOTcom. The opinions expressed here are entirely my own and not those of my employers, past, present or future (except where I quote others, who will need to accept responsibility for their own rants).