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

/boot/grub2/grubenv is no longer a symlink to /boot/efi/EFI/redhat/grubenv after ReaR recover on UEFI system

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • rhel-8.9.0
    • rear
    • None
    • None
    • Moderate
    • sst_cs_system_management
    • ssg_core_services
    • 5
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • x86_64
    • None

      What were you trying to do that didn't work?
      rear backup/restore

      Please provide the package NVR for which bug is seen:
      rear-2.6-11.el8_9.x86_64

      How reproducible:
      every time

      Steps to reproduce
      1. Create a rear backup on a system configured for UEFI boot. My setup is pretty standard:

      # grep -v '#' /etc/rear/local.conf
      OUTPUT=ISO
      BACKUP=NETFS
      BACKUP_URL=nfs://192.168.86.131/kickstarts/backup
      BACKUP_PROG_EXCLUDE=('/media/*' '/mnt/*' '/dev/shm/*')
      SECURE_BOOT_BOOTLOADER="/boot/efi/EFI/redhat/shimx64.efi"
      UEFI_BOOTLOADER=/boot/efi/EFI/redhat/grubx64.efi 

      My system does have /boot/grub2/grubenv as a symlink to /boot/efi/EFI/redhat/grubenv at this point.

      2. Create a backup
                # rear mkbackup

      3. Boot from the rear ISO that is generated and rescue the system
                # rear recover

      4. Reboot the system and /boot/grub2/grubenv is no longer a symlink:

      # ls -l /boot/grub2/grubenv 
      -rw-r--r--. 1 root root 1024 Apr 18 12:22 /boot/grub2/grubenv
      # file /boot/grub2/grubenv 
      /boot/grub2/grubenv: ASCII text, with very long lines

      Expected results:

      The recovered system should be identical to the system that I backed up, and /boot/grub2/grubenv should be a symlink. 

      Actual results:
      After recovery, /boot/grub2/grubenv is a file and does not match /boot/efi/EFI/redhat/grubenv:

      # diff /boot/grub2/grubenv /boot/efi/EFI/redhat/grubenv
      2,3c2,6 
      < boot_indeterminate=1 
      < ##########################################################################################################################################################################################
      ############################################################################################################################################################################################
      ############################################################################################################################################################################################
      ############################################################################################################################################################################################
      ############################################################################################################################################################################################                                                                              \ No newline at end of file
      — > saved_entry=7bc396bf5a7141ec969556f2f2d28dad-4.18.0-372.9.1.el8.x86_64 
      > kernelopts=root=/dev/mapper/rhel-root ro crashkernel=auto resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet  
      > boot_success=0 
      > boot_indeterminate=2 
      > ##########################################################################################################################################################################################
      ############################################################################################################################################################################################
      ############################################################################################################################################################################################
      ############################################################################################################################################################################################
      
      \ No newline at end of file      

       The observed impact of this issue so far is that edits to /etc/default/grub will not be applied to /boot/efi/EFI/redhat/grubenv after a "grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg" (but they are applied to /boot/grub2/grubenv), and enabling FIPS after a rear recover only adds the fips settings to /boot/grub2/grubenv and not /boot/efi/EFI/redhat/grubenv. 

            rhn-support-pcahyna Pavel Cahyna
            lagordon1@redhat.com Lark Gordon (Inactive)
            Pavel Cahyna Pavel Cahyna
            Jakub Haruda Jakub Haruda
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: