#3287 Issue closed: ERROR: Failed to create 'Relax-and-Recover' UEFI boot entry

Labels: support / question, fixed / solved / done

LordSpectre opened issue at 2024-07-20 05:40:

  • ReaR version ("/usr/sbin/rear -V"):
    Relax-and-Recover 2.7 / Git

  • OS version ("cat /etc/os-release" or "lsb_release -a" or "cat /etc/rear/os.conf"):
    PROXMOX Latest Version
    Distributor ID: Debian
    Description: Debian GNU/Linux 12 (bookworm)
    Release: 12
    Codename: bookworm

  • ReaR configuration files ("cat /etc/rear/site.conf" and/or "cat /etc/rear/local.conf"):

export TMPDIR="/backup/temp"
KEEP_BUILD_DIR="No"                  
BACKUP=NETFS
BACKUP_PROG=tar
BACKUP_URL="nfs://192.168.10.7/d/DOWNLOAD"
GRUB_RESCUE=1                    
SSH_ROOT_PASSWORD="xxxxxx"   
USE_STATIC_NETWORKING=1        
BACKUP_PROG_EXCLUDE=( ${BACKUP_PROG_EXCLUDE[@]} '/backup/*' '/backup/temp/*' )  
BACKUP_TYPE=incremental          
FULLBACKUPDAY="Mon"              
FULLBACKUP_OUTDATED_DAYS="3"
  • Hardware vendor/product (PC or PowerNV BareMetal or ARM) or VM (KVM guest or PowerVM LPAR):
    This is a test using VMWare VM before install everything in my primary homelab

  • System architecture (x86 compatible or PPC64/PPC64LE or what exact ARM device):
    x86-64 (amd64)

  • Firmware (BIOS or UEFI or Open Firmware) and bootloader (GRUB or ELILO or Petitboot):
    UEFI

  • Storage (local disk or SSD) and/or SAN (FC or iSCSI or FCoE) and/or multipath (DM or NVMe):
    local disk (VM Disk)

  • Storage layout ("lsblk -ipo NAME,KNAME,PKNAME,TRAN,TYPE,FSTYPE,LABEL,SIZE,MOUNTPOINT"):

NAME                           KNAME          PKNAME         TRAN   TYPE FSTYPE      LABEL  SIZE MOUNTPOINT
/dev/sr0                       /dev/sr0                      sata   rom  iso9660     PVE    1.3G 
/dev/nvme0n1                   /dev/nvme0n1                  nvme   disk                     60G 
|-/dev/nvme0n1p1               /dev/nvme0n1p1 /dev/nvme0n1   nvme   part                   1007K 
|-/dev/nvme0n1p2               /dev/nvme0n1p2 /dev/nvme0n1   nvme   part vfat               512M /boot/efi
`-/dev/nvme0n1p3               /dev/nvme0n1p3 /dev/nvme0n1   nvme   part LVM2_member       59.5G 
  |-/dev/mapper/pve-swap       /dev/dm-0      /dev/nvme0n1p3        lvm  swap               7.4G [SWAP]
  |-/dev/mapper/pve-root       /dev/dm-1      /dev/nvme0n1p3        lvm  ext4                25G /
  |-/dev/mapper/pve-data_tmeta /dev/dm-2      /dev/nvme0n1p3        lvm                       1G 
  | `-/dev/mapper/pve-data     /dev/dm-4      /dev/dm-2             lvm                    17.7G 
  `-/dev/mapper/pve-data_tdata /dev/dm-3      /dev/nvme0n1p3        lvm                    17.7G 
    `-/dev/mapper/pve-data     /dev/dm-4      /dev/dm-3             lvm                    17.7G
  • Description of the issue (ideally so that others can reproduce it):
    Got The following error:
    ERROR: Failed to create 'Relax-and-Recover' UEFI boot entry
    But I don't understand what's wrong, while the same exactly config works perfect in other machine without UEFI boot

  • Workaround, if any:
    N/A

  • Attachments, as applicable ("rear -D mkrescue/mkbackup/recover" debug log files):
    This is the full log:
    https://www.zerobin.net/?fddfc0720e4a4abf#zUm/BjdmEzNBITognXHVzZXKKv9llwJdfnfpCFxXdk4=

abbbi commented at 2024-07-20 14:38:

seems to fail during efibootmgr

++ efibootmgr
++ grep -q Relax-and-Recover
+++ grep -w /boot/efi /proc/mounts
+++ awk '{print $1}'
++ efi_disk_part=/dev/nvme0n1p2
+++ echo /dev/nvme0n1p2
+++ sed -e 's/[0-9]//g'
++ efi_disk=/dev/nvmenp
++ test /dev/nvmenp
+++ echo /dev/nvme0n1p2
+++ sed -e 's/[^0-9]//g'
++ efi_part=012
++ test 012
+++ efibootmgr
+++ grep BootOrder
+++ cut -d : -f2
++ efi_boot_order=' 0005,0000,0001,0002,0003,0004'
++ test 0005,0000,0001,0002,0003,0004
++ efibootmgr -c -d /dev/nvmenp -p 012 -L Relax-and-Recover -l '\EFI\BOOT\rear.efi'
Could not prepare Boot variable: No such file or directory
++ Error 'Failed to create '\''Relax-and-Recover'\'' UEFI boot entry'

during mkrescue rear attempts to create special boot entry for booting the recovery console.
grub-mkstandalone which creates the rear.efi exits OK, i guess maybe the wrong nvme target
is used in the call to efibootmgr:

efibootmgr -c -d /dev/nvmenp

that looks suspicious to me

Maybe related to: https://github.com/rear/rear/pull/3267

You could try without

https://github.com/rear/rear/commit/018913e04c34e314c0ad75db300eb26d8a798e0e

or use latest release version (2.6)

LordSpectre commented at 2024-07-21 05:24:

Great find, thank you, this 018913e solved the issue and now rear (always 2.7) is able to create uefi boot entry without error

jsmeix commented at 2024-07-22 06:57:

@abbbi
thank you for your help!

jsmeix commented at 2024-07-22 07:00:

@LordSpectre
I assume you meant that with the changes in
https://github.com/rear/rear/commit/018913e04c34e314c0ad75db300eb26d8a798e0e
now rear is able to create uefi boot entry without error.

I ask because @abbbi had written 'without' in his
https://github.com/rear/rear/issues/3287#issuecomment-2241171166

You could try without
https://github.com/rear/rear/commit/018913e04c34e314c0ad75db300eb26d8a798e0e

LordSpectre commented at 2024-07-22 08:12:

I assume you meant that with the changes in
018913e
now rear is able to create uefi boot entry without error.

Exactly, what I did is follow the instruction on 018913e. So, change the 940_grub2_rescue.sh as reported in the commit itself.


[Export of Github issue for rear/rear.]