Bug 2225477

Summary: Leapp upgrade in systems where the LVM2 package has been removed ends in emergency mode
Product: Red Hat Enterprise Linux 7 Reporter: Jesús Pérez Martínez <jeperez>
Component: leapp-repositoryAssignee: Leapp team <leapp-notifications>
Status: CLOSED NOTABUG QA Contact: Upgrades and Supportability <upgrades-and-supportability>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.9CC: pstodulk
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-07-25 12:55:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jesús Pérez Martínez 2023-07-25 12:16:58 UTC
Description of problem:
When a system uses LVM and the package LVM2 is removed (either completely or only from the RPM database), the preupgrade will return a greencheck and the upgrade initramfs will be generated including the LVM module:
~~~
[root@localhost boot]# rpm -qa | grep lvm2
[root@localhost boot]# lsinitrd /boot/initramfs-upgrade.x86_64.img | grep lvm | wc -l
22
~~~

However, during the actual upgrade the RHEL 8.8 initramfs will be created without the LVM module:
~~~
bash-4.4# lsinitrd /boot/initramfs-4.18.0-477.15.1.el8_8.x86_64.img | grep lvm | wc -l
0
~~~

The system ends up in emergency mode after the automatic reboot, because the LVs cannot be initialized.

Version-Release number of selected component (if applicable):
Latest

How reproducible:
Always

Steps to Reproduce:
1. Install RHEL with an LVM layout (the default automatic partition works fine).
2. Remove the LVM2 package from the system.
3. Run leapp upgrade.
4. Reboot to the upgrade initramfs, wait for the upgrade process to finish and boot with the RHEL 8 grub entry.

Actual results:
System ends up in emergency mode.

Expected results:
Leapp is able to catch this as an inhibitor.

Comment 3 Petr Stodulka 2023-07-25 12:55:10 UTC
Hi Jesus, thank you for the report. From our perspective, this is not a bug - this is actually broken system already. In case someone has LVM layout on the system, it is hard requirement to have installed LVM packages. Without lvm packages we are not even able to detect LVM configuration/layout (e.g. lvdisplay is not present...). It is analogical to the situation, when you use EFI boot but remove efibootmgr. From this point, closing as not a bug. User in this case mast have installed LVM related packages and it must be tracked by RPMDB.