#1564 Issue closed: EFI Boot Manager restoration issue

Labels: enhancement, fixed / solved / done

MarcoS80 opened issue at 2017-11-06 09:17:

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.2-git.0.b7927e5.unknown.changed / 2017-10-31
  • OS version (cat /etc/rear/os.conf or lsb_release -a): Ubuntu/17.04/i386
  • rear configuration files (cat /etc/rear/site.conf or cat /etc/rear/local.conf):
OUTPUT=ISO
BACKUP=NETFS
BACKUP_URL=iso:///backup
ISO_VOLID="REARISO"
OUTPUT_URL=file:///tmp
MODULES=( 'all_modules' )
  • Are you using legacy BIOS or UEFI boot? UEFI

  • Brief description of the issue:
    The EFI Boot Manager cannot be installed when the system has a nvme
    ssd, because the device name is resolved in /dev/nvme0n1p rather than
    /dev/nvme0n1.

  • Work-around, if any:
    In:
    /usr/share/rear/finalize/Linux-i386/630_run_efibootmgr.sh
    the following if statement:

if [[ (! -b $Disk) && ( ${Disk/nvme//} != $Disk  ) && ( ${Disk%p} ) ]] ; then
    Disk=${Disk%p}
fi

just after line 11 statement:

Disk=$( echo ${Dev%$ParNr} ) # /dev/sda or  /dev/mapper/vol34_part or /dev/mapper/mpath99p

can be used to check if a nvme device is in use and resolve the device name correctly

gozora commented at 2017-11-06 16:17:

@MarcoS80 (again ;-)) could you please open pull request for these changes?

Thanks

V.

MarcoS80 commented at 2017-11-06 17:03:

I'm sorry,
I don't think I can. Not at the moment, at least.
I didn't get the script through git. I installed a .deb package and modified the script on the spot.

gozora commented at 2017-11-06 17:23:

No rush, take your time.
If you've found something that can enhance ReaR, it is your right to open PR and become an contributor.
I can try to implement your thoughts into ReaR code, but I can't fully test its functionality as I'm not the proud owner of any nvme device :-(.

V.

kladiv commented at 2019-06-10 20:44:

+1

As workaround i added the code below in the file /usr/share/rear/finalize/Linux-i386/670_run_efibootmgr.sh, after eMMC trailing 'p' block:

# For NVMe devices the trailing 'p' in the Disk value
# (as in /dev/nvme0n1p that is derived from /dev/nvme0n1p1)
# needs to be stripped (to get /dev/nvme0n1), otherwise the
# efibootmgr call fails because of a wrong disk device name.
# See also https://github.com/rear/rear/issues/1564
if [[ $Disk = *'/nvme'+([0-9])n+([0-9])p ]] ; then
    Disk=${Disk%p}
fi

I successfully restored EFI bootloader on a Baremetal server + SSD Samsung EVO NVMe disk.

jsmeix commented at 2019-07-04 14:16:

I did not read about the details here but I just assume that
with https://github.com/rear/rear/pull/2160 merged
this issue is sufficiently fixed so that I close it hereby.
If not it can of course be reopened.


[Export of Github issue for rear/rear.]