RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2140011 - leapp can not find grub location for bios-grub gpt disks
Summary: leapp can not find grub location for bios-grub gpt disks
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: leapp-repository
Version: 8.6
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Petr Stodulka
QA Contact: Martin Klusoň
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-11-04 06:33 UTC by tbsky
Modified: 2023-11-14 17:01 UTC (History)
5 users (show)

Fixed In Version: leapp-repository-0.18.0-5.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-11-14 15:35:03 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
grub failed screenshot (22.67 KB, image/png)
2022-11-04 06:33 UTC, tbsky
no flags Details
leapp-upgrade.log (2.49 MB, text/plain)
2022-12-06 16:03 UTC, tbsky
no flags Details
leapp.db (9.68 MB, application/x-sqlite3)
2022-12-06 16:04 UTC, tbsky
no flags Details
leapp-upgrade.log(after upgrade) (3.63 MB, text/plain)
2022-12-08 04:17 UTC, tbsky
no flags Details
leapp.db(after upgrade) (11.32 MB, application/x-sqlite3)
2022-12-08 04:18 UTC, tbsky
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker OAMG-7835 0 None None None 2022-11-04 06:40:07 UTC
Red Hat Issue Tracker RHELPLAN-138305 0 None None None 2022-11-04 06:40:04 UTC
Red Hat Product Errata RHBA-2023:7013 0 None None None 2023-11-14 15:35:36 UTC

Description tbsky 2022-11-04 06:33:32 UTC
Created attachment 1922127 [details]
grub failed screenshot

I tried to upgrade a multiple disks mdadm BIOS system from 8.6 to 9.0 but failed.

so I create a 4 disks BIOS kvm vm to test. each disk is 2GB GPT format. and each disk has a biosboot grub partition, a raid-1 /boot partition, a raid-5 lvm partition. disk layout is below:

Device      Start     End Sectors  Size Type
/dev/vda1    2048    4095    2048    1M BIOS boot
/dev/vda2    4096  620543  616448  301M Linux RAID
/dev/vda3  620544 4192255 3571712  1.7G Linux RAID

the leapp upgrade gave warning at "leapp-report.txt" like below:

----------------------------------------
Risk Factor: high
Title: Leapp could not identify where GRUB core is located
Summary: We assume GRUB core is located on the same device as /boot. Leapp needs to update GRUB core as it is not done automatically on legacy (BIOS) systems.
Remediation: [hint] Please run "grub2-install <GRUB_DEVICE> command manually after upgrade
Key: ca7a1a66906a7df3da890aa538562708d3ea6ecd
----------------------------------------

the upgrade procedure is smooth. first reboot to upgrade.initramfs and it finished the job. the system reboot again automatically and then grub fall to rescue mode as screenshot.

I use install media and boot to rescue mode. "chroot /mnt/sysimage" and then "grub2-install /dev/vda". the system is happy now. it just lack one step.

I wonder if I can place the command "grub2-install /dev/vda" into upgrade.initramfs so I can prevent the rescue trouble. 

which leapp actor file can I put the "grub2-install /dev/vda" command?

Comment 1 Michal Reznik 2022-12-06 13:29:53 UTC
Hello, we actually have the functionality here:

https://github.com/oamg/leapp-repository/tree/master/repos/system_upgrade/common/actors/updategrubcore

Recently, we identified an issue in the "checkgrubcore" actor which is responsible for the report in your description but that should not affect running the command.

Could you please provide us with "/var/log/leapp/leapp-upgrade.log" and "/var/lib/leapp/leapp.db" files? Thanks...

Comment 2 tbsky 2022-12-06 16:03:36 UTC
Created attachment 1930506 [details]
leapp-upgrade.log

Comment 3 tbsky 2022-12-06 16:04:52 UTC
Created attachment 1930507 [details]
leapp.db

Comment 4 tbsky 2022-12-06 16:05:59 UTC
Hi:
   I recreate the vm and make sure the result is the same. attach leapp-upgrade.log and leapp.db

Comment 5 tbsky 2022-12-07 07:07:05 UTC
Hi:
   according to your hint, I modify the file updategrubcore.py. after that the upgrade process is very smooth. thanks a lot for the workaround.

Comment 6 Michal Reznik 2022-12-07 12:27:22 UTC
I am glad to hear you were able to workaround the issue on your own. I checked the files you provided but those are unfortunately only from the "preupgrade" phase. We will need the files from after the upgrade finished. Out of curiosity, what was the changes you performed to the "updategrubcore.py" file?

Comment 7 tbsky 2022-12-08 04:17:14 UTC
Hi:
   I do it again and get the files after upgrade via rescue mode. for curious I "grep grub2-install leapp-upgrade.log" and I found the upgrade procedure is doing "grub2-install /dev/vdd". since I am booting from "/dev/vda" so it failed. I change boot disk to "/dev/vdd" and it boot successfully. the original RHEL-8 system can boot from any drive. so I think the procedure should try to update grub at every possible drive.
   the updategrubcore.py I modified is from "cmd = ['grub2-install', grub_dev]" to "cmd = ['grub2-install', '/dev/vda']

Comment 8 tbsky 2022-12-08 04:17:59 UTC
Created attachment 1930959 [details]
leapp-upgrade.log(after upgrade)

Comment 9 tbsky 2022-12-08 04:18:40 UTC
Created attachment 1930960 [details]
leapp.db(after upgrade)

Comment 10 Michal Reznik 2022-12-09 13:03:54 UTC
Thank you very much for the follow-up and the data. It makes sense now. We will let you know when the fix is ready and would appreciate if you could verify it.

Comment 11 Petr Stodulka 2023-07-18 07:10:31 UTC
Resolved by upstream PR:
  * https://github.com/oamg/leapp-repository/pull/1093

Comment 20 errata-xmlrpc 2023-11-14 15:35:03 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (leapp-repository bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:7013


Note You need to log in before you can comment on or make changes to this bug.