#3115 Issue closed: ReaR 2.7 - SLES 15.5 - EFI variables are not supported on this system - Recovery

Labels: support / question, no-issue-activity

ramzcode opened issue at 2023-12-21 08:59:

  • ReaR version ("/usr/sbin/rear -V"):
    2.7

  • OS version ("cat /etc/os-release" or "lsb_release -a" or "cat /etc/rear/os.conf"):
    SLES 15.5

  • Hardware vendor/product (PC or PowerNV BareMetal or ARM) or VM (KVM guest or PowerVM LPAR):
    AWS EC2 VM / KVM

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

  • 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):
    NVMe

  • Description of the issue (ideally so that others can reproduce it):

While Running "rear recover" in the rescue environment, Bootloader installation fails.

  • Workaround, if any: None as of now.

Issue Specific Log:

++ bootloader='EFI\BOOT\grub.efi'
++ for efipart in $boot_efi_parts
+++ get_device_name /dev/nvme0n1p2
+++ local name=nvme0n1p2
+++ name=nvme0n1p2
+++ contains_visible_char nvme0n1p2
++++ tr -d -c '[:graph:]'
+++ test nvme0n1p2
+++ [[ nvme0n1p2 =~ ^mapper/ ]]
+++ [[ -L /dev/nvme0n1p2 ]]
+++ [[ nvme0n1p2 =~ ^dm- ]]
+++ name=nvme0n1p2
+++ echo /dev/nvme0n1p2
+++ [[ -r /dev/nvme0n1p2 ]]
+++ return 0
++ partition_block_device=/dev/nvme0n1p2
+++ get_partition_number /dev/nvme0n1p2
+++ local partition_block_device=/dev/nvme0n1p2
++++ echo /dev/nvme0n1p2
++++ grep -o -E '[0-9]+$'
+++ local partition_number=2
+++ test 2 -gt 0
+++ test 2 -le 128
+++ echo 2
++ partition_number=2
+++ get_device_from_partition /dev/nvme0n1p2 2
+++ local partition_block_device
+++ local device
+++ local partition_number
+++ partition_block_device=/dev/nvme0n1p2
+++ test -b /dev/nvme0n1p2
+++ partition_number=2
+++ device=/dev/nvme0n1p
+++ [[ /dev/nvme0n1p2 != /dev/nvme0n1p2 ]]
+++ [[ /dev/nvme0n1p = *\/\m\m\c\b\l\k+([0-9])p ]]
+++ [[ /dev/nvme0n1p = *\/\n\v\m\e+([0-9])n+([0-9])p ]]
+++ device=/dev/nvme0n1
+++ test -b /dev/nvme0n1
+++ echo /dev/nvme0n1
++ disk=/dev/nvme0n1
++ LogPrint 'Creating  EFI Boot Manager entry '\''SUSE_LINUX 15.5'\'' for '\''EFI\BOOT\grub.efi'\'' (UEFI_BOOTLOADER='\''/boot/efi/EFI/BOOT/grub.efi'\'') '
++ Log 'Creating  EFI Boot Manager entry '\''SUSE_LINUX 15.5'\'' for '\''EFI\BOOT\grub.efi'\'' (UEFI_BOOTLOADER='\''/boot/efi/EFI/BOOT/grub.efi'\'') '
++ test -w /var/log/brutils/brutils-ip-172-31-7-113.log
++ echo '2023-12-21 07:01:38.265015842 Creating  EFI Boot Manager entry '\''SUSE_LINUX 15.5'\'' for '\''EFI\BOOT\grub.efi'\'' (UEFI_BOOTLOADER='\''/boot/efi/EFI/BOOT/grub.efi'\'') '
2023-12-21 07:01:38.265015842 Creating  EFI Boot Manager entry 'SUSE_LINUX 15.5' for 'EFI\BOOT\grub.efi' (UEFI_BOOTLOADER='/boot/efi/EFI/BOOT/grub.efi') 
++ Print 'Creating  EFI Boot Manager entry '\''SUSE_LINUX 15.5'\'' for '\''EFI\BOOT\grub.efi'\'' (UEFI_BOOTLOADER='\''/boot/efi/EFI/BOOT/grub.efi'\'') '
++ Log efibootmgr --create --gpt --disk /dev/nvme0n1 --part 2 --write-signature --label '"SUSE_LINUX' '15.5"' --loader '"\EFI\BOOT\grub.efi"'
++ test -w /var/log/brutils/brutils-ip-172-31-7-113.log
++ echo '2023-12-21 07:01:38.271230092 efibootmgr --create --gpt --disk /dev/nvme0n1 --part 2 --write-signature --label "SUSE_LINUX 15.5" --loader "\EFI\BOOT\grub.efi"'
2023-12-21 07:01:38.271230092 efibootmgr --create --gpt --disk /dev/nvme0n1 --part 2 --write-signature --label "SUSE_LINUX 15.5" --loader "\EFI\BOOT\grub.efi"
++ efibootmgr --create --gpt --disk /dev/nvme0n1 --part 2 --write-signature --label 'SUSE_LINUX 15.5' --loader '\EFI\BOOT\grub.efi'
EFI variables are not supported on this system.
++ LogPrintError 'efibootmgr failed to create EFI Boot Manager entry on /dev/nvme0n1 partition 2 (ESP /dev/nvme0n1p2 )'
++ Log 'efibootmgr failed to create EFI Boot Manager entry on /dev/nvme0n1 partition 2 (ESP /dev/nvme0n1p2 )'
++ test -w /var/log/brutils/brutils-ip-172-31-7-113.log
++ echo '2023-12-21 07:01:38.279364912 efibootmgr failed to create EFI Boot Manager entry on /dev/nvme0n1 partition 2 (ESP /dev/nvme0n1p2 )'
2023-12-21 07:01:38.279364912 efibootmgr failed to create EFI Boot Manager entry on /dev/nvme0n1 partition 2 (ESP /dev/nvme0n1p2 )
++ PrintError 'efibootmgr failed to create EFI Boot Manager entry on /dev/nvme0n1 partition 2 (ESP /dev/nvme0n1p2 )'
++ is_true 1
++ case "$1" in
++ return 0
++ LogPrintError 'efibootmgr failed to create EFI Boot Manager entry for '\''EFI\BOOT\grub.efi'\'' (UEFI_BOOTLOADER='\''/boot/efi/EFI/BOOT/grub.efi'\'')'
++ Log 'efibootmgr failed to create EFI Boot Manager entry for '\''EFI\BOOT\grub.efi'\'' (UEFI_BOOTLOADER='\''/boot/efi/EFI/BOOT/grub.efi'\'')'
++ test -w /var/log/brutils/brutils-ip-172-31-7-113.log
++ echo '2023-12-21 07:01:38.285741702 efibootmgr failed to create EFI Boot Manager entry for '\''EFI\BOOT\grub.efi'\'' (UEFI_BOOTLOADER='\''/boot/efi/EFI/BOOT/grub.efi'\'')'
2023-12-21 07:01:38.285741702 efibootmgr failed to create EFI Boot Manager entry for 'EFI\BOOT\grub.efi' (UEFI_BOOTLOADER='/boot/efi/EFI/BOOT/grub.efi')
++ PrintError 'efibootmgr failed to create EFI Boot Manager entry for '\''EFI\BOOT\grub.efi'\'' (UEFI_BOOTLOADER='\''/boot/efi/EFI/BOOT/grub.efi'\'')'
++ return 1

jsmeix commented at 2023-12-21 12:57:

Works for me on my SLES15-SP4 test VM (QEMU/KVM)
even with Secure Boot:

RESCUE localhost:~ # rear -D recover
...
Running mkinitrd...
Recreated initrd (/sbin/mkinitrd).
Creating EFI Boot Manager entries...
Creating  EFI Boot Manager entry 'SUSE_LINUX 15.4' for 'EFI\sles\shim.efi' (UEFI_BOOTLOADER='/boot/efi/EFI/sles/shim.efi') 
Installing secure boot loader (shim)...
Running 'wrapup' stage ======================
Finished 'recover'. The target system is mounted at '/mnt/local'.

Except from what
usr/share/rear/finalize/Linux-i386/670_run_efibootmgr.sh
does in the log file:

++ disk=/dev/vda
++ LogPrint 'Creating  EFI Boot Manager entry '\''SUSE_LINUX 15.4'\'' for '\''EFI\sles\shim.efi'\'' (UEFI_BOOTLOADER='\''/boot/efi/EFI/sles/shim.efi'\'
') '
++ Log 'Creating  EFI Boot Manager entry '\''SUSE_LINUX 15.4'\'' for '\''EFI\sles\shim.efi'\'' (UEFI_BOOTLOADER='\''/boot/efi/EFI/sles/shim.efi'\'') '
++ test -w /var/log/rear/rear-localhost.log
++ echo '2023-12-21 13:53:30.021779451 Creating  EFI Boot Manager entry '\''SUSE_LINUX 15.4'\'' for '\''EFI\sles\shim.efi'\'' (UEFI_BOOTLOADER='\''/boo
t/efi/EFI/sles/shim.efi'\'') '
2023-12-21 13:53:30.021779451 Creating  EFI Boot Manager entry 'SUSE_LINUX 15.4' for 'EFI\sles\shim.efi' (UEFI_BOOTLOADER='/boot/efi/EFI/sles/shim.efi'
) 
++ Print 'Creating  EFI Boot Manager entry '\''SUSE_LINUX 15.4'\'' for '\''EFI\sles\shim.efi'\'' (UEFI_BOOTLOADER='\''/boot/efi/EFI/sles/shim.efi'\'') 
'
++ Log efibootmgr --create --gpt --disk /dev/vda --part 1 --write-signature --label '"SUSE_LINUX' '15.4"' --loader '"\EFI\sles\shim.efi"'
++ test -w /var/log/rear/rear-localhost.log
++ echo '2023-12-21 13:53:30.027151905 efibootmgr --create --gpt --disk /dev/vda --part 1 --write-signature --label "SUSE_LINUX 15.4" --loader "\EFI\sl
es\shim.efi"'
2023-12-21 13:53:30.027151905 efibootmgr --create --gpt --disk /dev/vda --part 1 --write-signature --label "SUSE_LINUX 15.4" --loader "\EFI\sles\shim.e
fi"
++ efibootmgr --create --gpt --disk /dev/vda --part 1 --write-signature --label 'SUSE_LINUX 15.4' --loader '\EFI\sles\shim.efi'
efibootmgr: ** Warning ** : Boot000B has same label SUSE_LINUX 15.4
BootCurrent: 0005
Timeout: 3 seconds
BootOrder: 000C,0001,000B,0002,0000,0003,0004,0005,0006,0007,0008,0009,000A
Boot0000* UiApp
Boot0001* sles-secureboot
Boot0002* UEFI Misc Device
Boot0003* EFI Internal Shell
Boot0004* UEFI QEMU DVD-ROM QM00001 
Boot0005* UEFI QEMU DVD-ROM QM00003 
Boot0006* UEFI Misc Device 2
Boot0007* UEFI PXEv4 (MAC:5254001BF414)
Boot0008* UEFI PXEv6 (MAC:5254001BF414)
Boot0009* UEFI HTTPv4 (MAC:5254001BF414)
Boot000A* UEFI HTTPv6 (MAC:5254001BF414)
Boot000B* SUSE_LINUX 15.4
Boot000C* SUSE_LINUX 15.4
++ NOBOOTLOADER=

abbbi commented at 2024-01-10 21:15:

booted via regular bios during recovery? missing efivarfs (modprobe) and as result sys/firmware/efi/efivars not correctly mounted? @ramzcode

schlomo commented at 2024-01-13 18:34:

@ramzcode you write that you use an AWS EC2 instance, did you configure your AMI to use uefi as described in https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html? Can you please check with efibootmgr -v (and share us the result) how it looks on your source machine? Or is this a P2V scenario where you try to restore a system onto AWS EC2 that was previously running somewhere else?

github-actions commented at 2024-03-14 02:01:

Stale issue message

ramzcode commented at 2024-04-19 07:06:

@schlomo Dropped 15.5 and tested with 15.2 and it worked, did not get time to test 15.5 further. Also moved was between AWS EC2


[Export of Github issue for rear/rear.]