Installer doesn't recognize existing LVM

We have numerous CentOS 7.9 servers and we’d like to migrate them all to RockyLinux. They all use LVM volumes.

I’m happy on formatting the root/swap LVM volumes, but I would like to keep the data volume intact.

However, the Rocky Linux installer does not recognize any of the LVM volumes. During the setup process the LVM group shows as “UNKNOWN” used space on the respective drives.

Respectively, there is no upgrade path from CentOS 7 to 8 (or Rocky Linux).

We tested this on one server but we had to move all the data out of the drives, install Rocky Linux, then recreate the LVM group and move the data back.

Do you have any suggestions on a sensible way to achieve this without moving the data? Any way to detect the LVM volumes during the install process?

I struggled with that some time ago. I can provide a kickstart that achieves what you want, but I also remember vaguely that it worked when done interactive, so maybe you missed some necessary step in anaconda.

Anyways, note that xfs in RHEL 8 has features that are not present in xfs in RHEL 7, notably reflink which is necessary for Copy-On-Write (COW). Depending on your use cases there could be performance advantages with COW. I dismissed that plan in the end because of that. Also note that you can not mount these newer filesystems on RHEL 7, although I suspect that xfs without reflink enabled is backwards compatible (I did not test that)

see the kickstarts that I tried

the kickstart for preserving /home in that gist is the not working one( 01_reinstall.ks), you need a %pre that triggers udev to reread the partition table, e.g.:

%pre
parted /dev/sda unit MiB print
%end

see also this thread on the kickstart mailing list
https://listman.redhat.com/archives/kickstart-list/2021-August/msg00000.html

1 Like

Well, in the interactive installer you select your disk and then select custom partitioning, then you end up in the “Manual Partitioning” screen. At the bottom you have the add, remove and rescan buttons. Click on rescan (it seems the equivalent to the parted trick in my %pre) and after that you will see your existing logical volumes.

1 Like