#2103 Issue closed: rear recover fails to create UEFI boot entry for eMMC device

Labels: enhancement, fixed / solved / done

fabz5 opened issue at 2019-03-29 18:46:

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.4 / Git current master (commit f6a36de48e733cb1f4996906f4995e18baf41797)

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

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

site.conf contains:

OUTPUT=ISO
OUTPUT_URL=nfs://mynfsserver/backupdir
BACKUP=NETFS
BACKUP_URL=nfs://mynfsserver/backupdir
  • Hardware (PC or PowerNV BareMetal or ARM) or virtual machine (KVM guest or PoverVM LPAR):
    PC (Minis Forum Z83-F)

  • 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, GRUB (2.02~beta3-5+deb9u1)

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

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

rear recover

fails to create an UEFI boot entry, since efibootmgr is called with a wrong disk device name (/dev/mmcblk0p). The trailing "p" for "partition" is not being removed.

  • Workaround, if any:
    Manually call efibootmgr with the correct disk device name.

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

jsmeix commented at 2019-04-01 06:50:

This is some kind of follow up of https://github.com/rear/rear/issues/2087
towards full support of mmcblk disk types in ReaR.

@fabz5
many thanks for your continuous testing and your contributions
towards full support of mmcblk disk types in ReaR.

jsmeix commented at 2019-04-01 07:01:

Excerpt from https://github.com/rear/rear/files/3024025/rear-testvm02.log
that shows how the wrong $Disk value /dev/mmcblk0p instead of /dev/mmcblk0p
for the efibootmgr --create --gpt --disk ${Disk} call happens:

+ source /usr/share/rear/finalize/Linux-i386/670_run_efibootmgr.sh
++ is_true 1
++ case "$1" in
++ return 0
++ is_true no
++ case "$1" in
++ return 1
++ test -f /mnt/local//boot/efi/EFI/debian/grubx64.efi
+++ df -P /mnt/local//boot/efi/EFI/debian/grubx64.efi
+++ tail -1
+++ awk '{print $6}'
++ esp_mountpoint=/mnt/local/boot/efi
++ test /mnt/local/boot/efi
++ test -d /mnt/local/boot/efi
+++ mount
+++ grep /mnt/local/boot/efi
+++ awk '{print $1}'
++ BootEfiDev=/dev/mmcblk0p1
+++ get_device_name /dev/mmcblk0p1
+++ local name=mmcblk0p1
+++ name=mmcblk0p1
+++ contains_visible_char mmcblk0p1
++++ tr -d -c '[:graph:]'
+++ test mmcblk0p1
+++ [[ mmcblk0p1 =~ ^mapper/ ]]
+++ [[ -L /dev/mmcblk0p1 ]]
+++ [[ mmcblk0p1 =~ ^dm- ]]
+++ name=mmcblk0p1
+++ echo /dev/mmcblk0p1
+++ [[ -r /dev/mmcblk0p1 ]]
+++ return 0
++ Dev=/dev/mmcblk0p1
+++ get_partition_number /dev/mmcblk0p1
+++ local partition=/dev/mmcblk0p1
++++ echo /dev/mmcblk0p1
++++ grep -o -E '[0-9]+$'
+++ local number=1
+++ '[' 1 -gt 0 ']'
+++ StopIfError 'Partition number '\''1'\'' of partition /dev/mmcblk0p1 is not a valid number.'
+++ ((  0 != 0  ))
+++ ((  1 <= 128  ))
+++ StopIfError 'Partition /dev/mmcblk0p1 is numbered '\''1'\''. More than 128 partitions is not supported.'
+++ ((  0 != 0  ))
+++ echo 1
++ ParNr=1
+++ echo /dev/mmcblk0p
++ Disk=/dev/mmcblk0p

jsmeix commented at 2019-04-03 12:43:

With https://github.com/rear/rear/pull/2104 merged
this issue should be fixed.


[Export of Github issue for rear/rear.]