Rocky Linux 9 conversion with migrate2rocky9.sh fails while updating GRUB on UEFI

Hi everyone,

I’m experiencing an issue during the conversion of RHEL systems to Rocky Linux.

The issue seems to affect conversions to Rocky Linux 9, while the same conversion procedure on RHEL 8 systems to Rocky Linux 8 completes successfully without this GRUB issue.

During the Rocky Linux 9 conversion, the process fails while updating the GRUB configuration with the following error:

Running `grub2-mkconfig -o /boot/efi/EFI/rocky/grub.cfg' will overwrite the GRUB wrapper.
Please run `grub2-mkconfig -o /boot/grub2/grub.cfg' instead to update grub.cfg.
GRUB configuration file was not updated.

Error updating the grub config.

An error occurred while we were attempting to convert your system to Rocky Linux. Your system may be unstable. Script will now exit to prevent possible damage.

It appears that the conversion process is trying to execute:

grub2-mkconfig -o /boot/efi/EFI/rocky/grub.cfg

but on Rocky Linux 9 this file is an EFI GRUB wrapper, and the actual GRUB configuration should instead be generated with:

grub2-mkconfig -o /boot/grub2/grub.cfg

The systems are booting in UEFI mode.

An important detail is that I have tested the same conversion procedure on multiple systems:

  • RHEL 8 → Rocky Linux 8: conversion completes successfully and I don’t encounter this GRUB error.
  • RHEL 9 → Rocky Linux 9: conversion fails during the GRUB configuration update with the error shown above.

Has anyone else encountered this issue specifically when converting RHEL 9 systems to Rocky Linux 9?

Is this a known issue or incompatibility in the conversion script related to the GRUB/UEFI configuration used by Rocky Linux 9?

Also, what is the recommended recovery procedure after the conversion stops at this point?

Would manually running:

grub2-mkconfig -o /boot/grub2/grub.cfg

I have not rebooted the affected system after the failed conversion.

Thank you in advance to anyone who can share their experience or provide guidance on the correct procedure to follow.

Manually running grub2-mkconfig -o /boot/grub2/grub.cfg should fix the problem.

After running that, could you please run:

efibootmgr -v
ls -l /boot/efi/EFI/rocky/
grubby --default-kernel

We want to make sure the Rocky kernel is in place for you