System failure as a result of running convert2rhel
Yuri6037 opened this issue · comments
I recently tried to convert a CentOS 8 Linux x86_64 VM to RHEL x86_64. After running the script the install was broken. Here is a report of the incident:
- The tool started execution, and moved things arround too quickly before failing cause of tainted kernel.
- The script entered rollback state.
- The rollback operation forgot to restore some files such as /etc/os-release and left some of the new RHEL tools still available. At this point the system is in a mixed-transition state and cannot properly reboot.
- The next reboot obviously leads to emergency shell due to /etc/os-release not restored.
After some research it appears the file /etc/os-release
is provided by a package named redhat-release
on RHEL and centos-release
on CentOS. My guess is the script started to uninstall the centos-release
package but the rollback operation forgot or failed to re-install the missing package.
After these findings the process to restore the system at this point is to mount /dev, /sys and /proc in the damaged system root and chroot into it. Then you can apply these commands one after the other:
- echo "stock" > /etc/yum/vars/infra
- dhclient
- dnf install centos-release --releasever 8
- dnf update
And don't forget to disable SELinux as some of it's base policies might have not been restored.
Hi, could you provide the log file? It should be in /var/log/convert2rhel/convert2rhel.log
Here is the full log of the initial failed attempt, the attempt which broke the system after removing centos-release: https://pastebin.com/gkQLT2sF
Thanks! We're underway to fix the rollback in #238 so that the packages should be properly restored, sorry about that
@zhukovgreen does the kmods inhibitor work as expected in the log file? kmods is your expertise, I don't know much about it
Hi @Yuri6037, I see that your system is not up-to-date.
The current kernel version is 4.18.0-240-.22.1.el8_3
This 99% the reason for the failure.
Please do dnf update and reboot. Then the utility should work well.
Sorry, @Yuri6037, convert2rhel can't perform the check of the unsupported kernel modules earlier. The tool first needs to get access to RHEL repos (through subscription-manager) to see what kernel modules are available.
@zhukovgreen is right, your system is CentOS 8.2 but it needs to be updated to the latest available version of CentOS packages (CentOS 8.3) first.
Citing the official guide Converting from an RPM-based Linux distribution to RHEL:
- Update packages from the original OS to the latest version that is available in the repositories accessible from the system and reboot the system:
# yum update -y # reboot
You must perform the conversion from the latest version of the OS to use the rollback feature in case the conversion fails.
The last paragraph also mentions that not updating the system first leads to a non-functioning rollback capability, which unfortunately was your case as well.