Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-4388

EFI grub.cfg wrapper doesn't always execute properly, leading to getting "grub>" prompt

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • rhel-9.1.0
    • grub2
    • None
    • Medium
    • sst_desktop_firmware_bootloaders
    • ssg_desktop
    • 3
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • If docs needed, set a value
    • None

      Description of problem:

      With RHEL9, the /boot/efi/EFI/redhat/grub.cfg file is now a wrapper redirecting to unified configuration file /boot/grub2/grub.cfg.
      It appears that the wrapper can fail to find /boot partition (or / if /boot and / are merged). This especially happens if /boot/efi is on its own disk (e.g. /dev/vda) while the rest is on another disk (e.g. /dev/vdb).

      The root cause is EFI firmware didn't plumb all disks, but only the one hosting /boot/efi.

      This happens at least with VMWare at hardware level 19 and QEMU/KVM (Fedora 37).

      The solution is to add the following stanza before searching for the device:
      -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
      connectefi scsi
      -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

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

      grub2-common-2.06-46.el9.noarch and later

      How reproducible:

      Always

      Steps to Reproduce:
      1. Create a QEMU/KVM VM with 2 disks

      vda: 1GB, which will host /boot/efi
      vdb: 10GB, which will host the rest

      2. Install the system making sure /boot/efi is on vda and the rest on vdb
      3. Poweroff the system once installation complete (don't just reboot)

      4. Boot the system on disk

      Actual results:

      Grub prompt

      Expected results:

      System boots

      Additional info:

      At Grub prompt we can see only vda is connected, preventing /boot from being found:
      -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
      grub> ls
      (proc) (hd0) (hd0,gpt1)

      grub> cat /efi/redhat/grub.cfg
      grub> cat /efi/redhat/grub.cfg
      search --no-floppy --fs-uuid --set=dev f2ed30fe-ff8d-44bc-9b06-342f4f31f6b1
      set prefix=($dev)/grub2

      export $prefix
      configfile $prefix/grub.cfg

      grub> search --no-floppy --fs-uuid --set=dev f2ed30fe-ff8d-44bc-9b06-342f4f31f6b1
      error: ../../grub-core/commands/search.c:315:no such device: f2ed30fe-ff8d-44bc-9b06-342f4f31f6b1.
      -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

      After executing "connectefi scsi", the partition is found:
      -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
      grub> connectefi scsi
      grub> ls
      (proc) (hd0) (hd0,gpt1) (hd1) (hd1,gpt2) (hd1,gpt1) (cd0) (cd0,msdos2) (lvm/rhel-swap) (lvm/rhel-root)
      grub> search --no-floppy --fs-uuid --set=dev f2ed30fe-ff8d-44bc-9b06-342f4f31f6b1
      -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

            bootloader-eng-team bootloader -eng-team
            rhn-support-rmetrich Renaud Métrich
            bootloader -eng-team bootloader -eng-team
            Release Test Team Release Test Team
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: