#3362 Issue open: Artix Linux: update defaults or documentation to make EFI-bootable rescue systems on USB devices simpler

Labels: support / question

castilma opened issue at 2024-12-11 21:25:

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

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

OUTPUT=USB
USB_DEVICE="/dev/disk/by-label/REAR-000"
USING_UEFI_BOOTLOADER=1

BOOTLOADER="EFI"

BACKUP=REQUESTRESTORE
  • Hardware vendor/product (PC or PowerNV BareMetal or ARM) or VM (KVM guest or PowerVM LPAR):
    PC

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

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

I spent multiply hours the last days getting a rescue system as either a rawimage (to later dd(1) onto a usb device) or directly on a usb device that would boot on my laptop.

The (almost silent, i.e. no WARNING prefix being logged before) skipping of some steps made it more difficult for me to find out, what/where the issue is, until I found (ok, I admit, read) a relevant line in the rear -v mkrescue output.
(In my defense, the verbose output contains a lot of lines, and the important ones are not prefixed with a big WARNING or similar.)
I just saw the empty /dev/sdb1 (efi partition)

I looked through default.conf and saw

# USING_UEFI_BOOTLOADER
#
# UEFI (Secure booting) support is partly available in ReaR (at least for Fedora, RHEL)
…
# The next variable can explicitly specify whether or not an UEFI bootloader should be used:
# USING_UEFI_BOOTLOADER=   means let ReaR try to find it out by itself (default)

I ignored it, because it adds (Secure booting), which is not what I want.
Now I feel that by default rear should make a EFI bootable usb device, at least if there is a 'REAR-EFI' partition, which is created by rear format -- --efi /dev/sdb, which kinda states intent to boot this on an EFI compatible computer.
This is what I would expect what 'finding out by itself' means.
It seems, that's not what it actually does.
Only explicitly setting =1 passes this check (If I understand this code correctly) :
https://github.com/rear/rear/blob/40cbaaf50b689b73be77b9a12b4321a787db6681/usr/share/rear/output/USB/Linux-i386/100_create_efiboot.sh#L20-L25

Anyways, I also found

# Bootloader used for the USB medium.
# At the moment only empty/unset and "grub" is supported.
# USB_BOOTLOADER="grub" uses GRUB2 as bootloader for USB with BIOS. GRUB Legacy is not supported.
# Default is using GRUB2 for EFI other then elilo, extlinux for ext, syslinux otherwise:
USB_BOOTLOADER=

The last comment line seems not to be correct english, which made it guess what it means.
One (wrong) thing I understood is rear creates a EFI bootable rescue USB device by default.
Since that is wrong, I would suggest to explicitly mention that USING_UEFI_BOOTLOADER needs to be set.

The user guide states

OUTPUT=RAWDISK: Create a bootable raw disk image on as rear-$(hostname).raw.gz. Supports UEFI boot if syslinux/EFI or Grub 2/EFI is installed. Supports Legacy BIOS boot if syslinux is installed. Supports UEFI/Legacy BIOS dual boot if syslinux and one of the supported EFI bootloaders are installed.

which again sounds to me like the rescue system will be UEFI-bootable if the relevant packages are installed.

Looking at some other issues about UEFI this does not seem to be a priority usecase. But I'd be happy if you update the docs so other people don't have to loose as much time with this as I did.

jsmeix commented at 2024-12-12 08:48:

@castilma
because of your
https://github.com/rear/rear/issues/3361
I assume you use Artix Linux also here.

The whole booting setup of the ReaR recovery system
has become a mess of various pieces and methods
that has grown over a long time
BUT
we at ReaR upstream do not have the manpower
to properly clean it up and overhaul it
SO
things stay "as is" as long as noone finds the time
to contribute what is needed to substantially
improve things.

With careful manual configuration
things can be made working as needed
for one's specific use case.

In general regarding Artix Linux:

Artix Linux is not one of the known to be
supported Linux based operating systems, see
"Supported and Unsupported Operating Systems" in
https://github.com/rear/rear/blob/master/doc/rear-release-notes.txt

In particular we at ReaR upstream do not use Artix Linux.

https://en.wikipedia.org/wiki/Artix_Linux
reads

Artix does not use systemd,
instead opting to provide OpenRC, runit, s6, and dinit,
in its place.

This calls for problems because ReaR does not support
any other init system than the nowadays usual systemd
and to some extent SysVinit but this is no longer tested.

So likely your ReaR recovery system may fail
to boot and/or fail to startup because currently
ReaR has no support to setup the init system for
the ReaR recovery system when on the original system
OpenRC, runit, s6, or dinit is used as init system.

FYI
in general you may have a look at the section
"Inappropriate expectations" in
https://en.opensuse.org/SDB:Disaster_Recovery

jsmeix commented at 2024-12-18 15:11:

With
https://github.com/rear/rear/commit/d5b48f30e299049c9e6d5df1d1a19b74b3b8bdcf
I improved the USB_BOOTLOADER description in default.conf
to make it clear that for UEFI with GRUB2 also
USING_UEFI_BOOTLOADER must be set appropriately,
see https://github.com/rear/rear/pull/3364


[Export of Github issue for rear/rear.]