#2516 Issue closed: GRUB_RESCUE=1 fails "grub-mkstandalone: error: cannot open `/boot/efi/EFI/BOOT/rear.efi': No such file or directory"

Labels: support / question, no-issue-activity

jpa57 opened issue at 2020-11-12 18:42:

Relax-and-Recover (ReaR) Issue Template

Fill in the following items before submitting a new issue
(quick response is not guaranteed with free support):

  • ReaR version ("/usr/sbin/rear -V"):
Relax-and-Recover 2.6 / 2020-06-17
  • OS version ("cat /etc/os-release" or "lsb_release -a" or "cat /etc/rear/os.conf"):
admin@roadrunner:/$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.7 LTS
Release:    16.04
Codename:   xenial
  • ReaR configuration files ("cat /etc/rear/site.conf" and/or "cat /etc/rear/local.conf"):
  • Hardware (PC or PowerNV BareMetal or ARM) or virtual machine (KVM guest or PoverVM LPAR):
Intel NUC Celeron - PC
  • System architecture (x86 compatible or PPC64/PPC64LE or what exact ARM device):
  • Firmware (BIOS or UEFI or Open Firmware) and bootloader (GRUB or ELILO or Petitboot):
  • Storage (local disk or SSD) and/or SAN (FC or iSCSI or FCoE) and/or multipath (DM or NVMe):
SSD 110GB /dev/sda
USB 16GB /dev/sdb1
  • Storage layout ("lsblk -ipo NAME,KNAME,PKNAME,TRAN,TYPE,FSTYPE,SIZE,MOUNTPOINT" or "lsblk" as makeshift):
/dev/sdb    /dev/sdb           usb    disk         14.4G 
|-/dev/sdb2 /dev/sdb2 /dev/sdb        part ext4      14G /media/sdb2
`-/dev/sdb1 /dev/sdb1 /dev/sdb        part ext4     512M 
/dev/sda    /dev/sda           sata   disk        111.8G 
|-/dev/sda2 /dev/sda2 /dev/sda        part ext4   110.3G /
|-/dev/sda3 /dev/sda3 /dev/sda        part swap   976.5M [SWAP]
`-/dev/sda1 /dev/sda1 /dev/sda        part vfat     512M /boot/efi
  • Description of the issue (ideally so that others can reproduce it):

formatted the USB stick with:

sudo rear format -- --efi /dev/sdb

then labelled using gparted - adding labels to /dev/sdb1 (REAR-EFI) and /dev/sdb2 (REAR-RRB)

then run:

sudo rear mkrescue

fails with

2020-11-12 10:21:12.591819132 Including output/default/940_grub2_rescue.sh
2020-11-12 10:21:12.595587920 Setting up GRUB_RESCUE: Adding Relax-and-Recover rescue system to the local GRUB 2 configuration.
2020-11-12 10:21:12.826703953 GRUB2 modules to load: ext2 fat part_gpt
grub-mkstandalone: error: cannot open `/boot/efi/EFI/BOOT/rear.efi': No such file or directory.
2020-11-12 10:21:12.885485889 ERROR: Failed to make bootable EFI image of GRUB2 (error during grub-mkstandalone of /boot/efi/EFI/BOOT/rear.efi)

Without GRUB_RESCUE, it appears to finish successfully, but the drive is not recognized by the BIOS on boot up. I have another UEFI USB drive that is recognized, so I don't think it's the BIOS settings.

  • Workaround, if any:

None known

  • Attachments, as applicable ("rear -D mkrescue/mkbackup/recover" debug log files):

jsmeix commented at 2020-11-13 10:24:

I am not a bootloader expert and even less a UEFI expert
so I cannot actually help with UEFI bootloader setup issues.

You wrote contradicting info:
On the one hand you wrote

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

but on the other hand you wrote contradictingly

/dev/sda    /dev/sda           sata   disk        111.8G 
|-/dev/sda2 /dev/sda2 /dev/sda        part ext4   110.3G /
|-/dev/sda3 /dev/sda3 /dev/sda        part swap   976.5M [SWAP]
`-/dev/sda1 /dev/sda1 /dev/sda        part vfat     512M /boot/efi
sudo rear format -- --efi /dev/sdb

which indicate that you use UEFI.

I assume BIOS / GRUB is wrong and actually
you use UEFI firmware and GRUB2 as bootloader.

On first glance I spotted COPY_AS_IS=1 in your local.conf
which is clearly wrong, see usr/share/rear/conf/default.conf
how each config variable is meant to be used

In particular GRUB_RESCUE has nothing to do with the
bootloader of the ReaR recovery system on your USB drive
(see its description in default.conf).

See the "BOOTLOADER" related config variables in default.conf
about possible settings for the ReaR recovery system bootloader.

So first of all remove that COPY_AS_IS=1 from your local.conf
to be safe against its bad consequences.
When I use COPY_AS_IS=1 the whole ReaR in usr/share/rear
is missing in the recovery system so "rear recover" cannot work.

Then play around with "BOOTLOADER" related config variables
(in particular UEFI bootloader related things) and try to make
the ReaR recovery system bootloader on your USB drive working for you.

Regarding OUTPUT=USB fails to UEFI boot from a USB drive
see also the related issue https://github.com/rear/rear/issues/2500
so also try if OUTPUT=RAWDISK works better for you as described in
and subsequent comments.

If all that does not result a ReaR recovery system bootloader
on your USB drive that can boot via UEFI
attach your latest "rear -D mkrescue" debug log file to this issue
so that others who know about UEFI bootloader setup issues
have a chance to understand what goes on on your particular system.

github-actions commented at 2021-01-13 02:50:

Stale issue message

jpa57 commented at 2021-01-13 13:02:

Thanks for the help. I meant to update it once I resolved it but totally forgot. It was all my misunderstanding of the settings as described

[Export of Github issue for rear/rear.]