FFU 13 to 16.1: Leapp fails to update the kernel on UEFI based systems and /etc/fstab does not contain the EFI partition

Solution Verified - Updated

Environment

  • Red Hat OpenStack Platform 16.1
  • Framework for Upgrades 13 to 16.1 (FFU)

Issue

  • During the overcloud upgrade, when running the upgrade command with the system_upgrade tag, overcloud nodes are booted from the old kernel after the Leapp upgrade and FFU fails.

Resolution

Note: The public visibility of the above mentioned RHBZ may change during the period of time. Contact Technical Support to get more details on RHBZ in case of any issue.

  • Following steps can be used to workaround the issue and get past the error observed in system_upgrade steps of overcloud nodes.

    1. Copy /boot/efi/EFI/redhat to /tmp/<backup>.

    2. As the root user, add the /etc/fstab entry for /boot/efi that points to the EFI partition. For example:

      echo UUID=`blkid -s UUID -o value "$(blkid -t TYPE=vfat | grep -i efi | cut -d ':' -f1)"` /boot/efi vfat umask=0077 0 1 >> /etc/fstab
      
    3. As the root user, mount /boot/efi:

      mount /boot/efi
      
    4. Copy /tmp/<backup> to /boot/efi/EFI/redhat.

      NOTE : On RHEL8, ensure that /boot/grub2/grubenv is a link to the file in /boot/efi/EFI/redhat:

      ll /boot/grub2/grubenv 
      lrwxrwxrwx. 1 root root 25 Jul  8  2022 /boot/grub2/grubenv -> ../efi/EFI/redhat/grubenv
      
    5. Create the boot record:

      DEVICE_PATH="$(blkid -t TYPE=vfat | grep -i efi | cut -d ':' -f1)"
      DEVICE="$(lsblk -no pkname $DEVICE_PATH)"
      PARTITION="$(echo $DEVICE_PATH | awk '{print $NF}' FS=/$DEVICE)"
      efibootmgr -c -L 'Red Hat Enterprise Linux' -d $(echo $DEVICE_PATH | sed s/$PARTITION\$//) -p $PARTITION -l '\EFI\redhat\shimx64.efi'
      
    6. Create the grub config file:

      grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
      
    7. Reboot the system.

      sudo reboot
      

Root Cause

  • It is likely that systems that use UEFI boot and a UEFI bootloader in OSP13 might run into UEFI This content is not included.RHBZ#1925078 that results in:

    • /etc/fstab not being updated
    • grub-install is incorrectly used on EFI system

Diagnostic Steps

  1. On the affected system, check if the system was booted using EFI. The following path must exist:

     stat /sys/firmware/efi
    
  2. Check if the EFI partition is present in /etc/fstab:

     grep efi /etc/fstab
    

    If it is not present, you are running into this issue.

  3. Run the following command:

     efibootmgr -v | grep red
    

    If you have a boot record with the name red, you are running into this issue.

SBR
Components
Category
Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.