#2545 Issue closed: grub menu does not contain rear -option although site.conf contains GRUB_RESCUE=y

Labels: enhancement, support / question, needs sponsorship, no-issue-activity

jk-10 opened issue at 2020-12-16 19:57:

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-git.4230.80821448.master / 2020-12-10
  • OS version ("cat /etc/os-release" or "lsb_release -a" or "cat /etc/rear/os.conf"):
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:    20.04
Codename:   focal
  • ReaR configuration files ("cat /etc/rear/site.conf" and/or "cat /etc/rear/local.conf"):
cat /etc/rear/local.conf 
# This file etc/rear/local.conf is intended for the user's
# manual configuration of Relax-and-Recover (ReaR).
# For configuration through packages and other automated means
# we recommend a separated file named site.conf next to this file
# and leave local.conf as is (ReaR upstream will never ship a site.conf).
# The default OUTPUT=ISO creates the ReaR rescue medium as ISO image.
# You need to specify your particular backup and restore method for your data
# as the default BACKUP=REQUESTRESTORE does not really do that (see "man rear").
# Configuration variables are documented in /usr/share/rear/conf/default.conf
# and the examples in /usr/share/rear/conf/examples/ can be used as templates.
# ReaR reads the configuration files via the bash builtin command 'source'
# so bash syntax like VARIABLE="value" (no spaces at '=') is mandatory.
# Because 'source' executes the content as bash scripts you can run commands
# within your configuration files, in particular commands to set different
# configuration values depending on certain conditions as you need like
# CONDITION_COMMAND && VARIABLE="special_value" || VARIABLE="usual_value"
# but that means CONDITION_COMMAND gets always executed when 'rear' is run
# so ensure nothing can go wrong if you run commands in configuration files.

cat /etc/rear/site.conf
#
# This is ReaR site specific conf file.
#

# Defaults in use: page 4
#
# OUTPUT=ISO
#
# BACKUP=REQUESTRESTORE

# Required progs, page 15
REQUIRED_PROGS+=('tree' 'mc' 'lynx')

# Copy as is, ~/bin2/borg is standalone version, page 16
COPY_AS_IS+=("/etc/dskcnf" "/home/jk/bin" "/home/jk/Documents/system" "/home/jk/bin2/borg")

# Trusted file owners, page 17
TRUSTED_FILE_OWNERS+=( 'jk' )

# Clone users, groups, page 18
CLONE_USERS+=( 'jk' )
CLONE_GROUPS+=( 'jk' )

# Keep build dir for checking build contents, page 19
KEEP_BUILD_DIR="yes"

# Time synchronisation, could be NTP, CHRONY, NTPDATE, RDATE or empty: page 20
TIMESYNC=NTP

# Only include VG, page 32
ONLY_INCLUDE_VG=( "vg0" )

# Autoexclude filesystems
AUTOEXCLUDE_PATH=( /media /mnt /home/jk )

# GRUB rescue, page 34
GRUB_RESCUE=y
  • Hardware (PC or PowerNV BareMetal or ARM) or virtual machine (KVM guest or PoverVM LPAR):
inxi -Fxz
System:    Kernel: 5.4.0-58-generic x86_64 bits: 64 compiler: gcc v: 9.3.0 Desktop: MATE 1.24.0 
           Distro: Ubuntu 20.04.1 LTS (Focal Fossa) 
Machine:   Type: Mini-pc System: Intel Client Systems product: NUC7PJYH v: J67992-403 serial: <filter> 
           Mobo: Intel model: NUC7JYB v: J67969-403 serial: <filter> UEFI: Intel v: JYGLKCPX.86A.0050.2019.0418.1441 
           date: 04/18/2019 
CPU:       Topology: Quad Core model: Intel Pentium Silver J5005 bits: 64 type: MCP arch: Goldmont Plus rev: 1 
           L2 cache: 4096 KiB 
           flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 11980 
           Speed: 1472 MHz min/max: 800/2800 MHz Core speeds (MHz): 1: 1208 2: 1227 3: 1219 4: 1199 
Graphics:  Device-1: Intel UHD Graphics 605 driver: i915 v: kernel bus ID: 00:02.0 
           Display: server: X.Org 1.20.8 driver: modesetting unloaded: fbdev,vesa resolution: 1600x1200~60Hz 
           OpenGL: renderer: Mesa Intel UHD Graphics 605 (GLK 3) v: 4.6 Mesa 20.0.8 direct render: Yes 
Audio:     Device-1: Intel driver: snd_hda_intel v: kernel bus ID: 00:0e.0 
           Sound Server: ALSA v: k5.4.0-58-generic 
Network:   Device-1: Intel driver: iwlwifi v: kernel port: f000 bus ID: 00:0c.0 
           IF: wlo2 state: down mac: <filter> 
           Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Intel driver: r8169 v: kernel port: e000 
           bus ID: 02:00.0 
           IF: eno1 state: up speed: 1000 Mbps duplex: full mac: <filter> 
           IF-ID-1: docker0 state: down mac: <filter> 
Drives:    Local Storage: total: 10.92 TiB used: 252.42 GiB (2.3%) 
           ID-1: /dev/sda type: USB model: 1WDC WD3001FFSX-68JNUN0 DB987654321138D size: 2.73 TiB 
           ID-2: /dev/sdb vendor: Western Digital model: WDS100T2G0A-00JH30 size: 931.52 GiB temp: 38 C 
           ID-3: /dev/sdc type: USB vendor: Western Digital model: WD My Book 25EE size: 7.28 TiB 
Partition: ID-1: / size: 894.72 GiB used: 251.83 GiB (28.1%) fs: ext4 dev: /dev/dm-0 
           ID-2: /boot size: 968.3 MiB used: 586.7 MiB (60.6%) fs: ext4 dev: /dev/sdb2 
Sensors:   System Temperatures: cpu: 43.0 C mobo: N/A 
           Fan Speeds (RPM): N/A 
Info:      Processes: 280 Uptime: 32m Memory: 15.23 GiB used: 6.92 GiB (45.4%) Init: systemd runlevel: 5 Compilers: gcc: 9.3.0 
           Shell: bash v: 5.0.17 inxi: 3.0.38
  • System architecture (x86 compatible or PPC64/PPC64LE or what exact ARM device): x86_64

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

  • Storage (local disk or SSD) and/or SAN (FC or iSCSI or FCoE) and/or multipath (DM or NVMe): /boot and / stored on local SSD

  • Storage layout ("lsblk -ipo NAME,KNAME,PKNAME,TRAN,TYPE,FSTYPE,SIZE,MOUNTPOINT" or "lsblk" as makeshift):

lsblk -ipo NAME,KNAME,PKNAME,TRAN,TYPE,FSTYPE,SIZE,MOUNTPOINT
NAME                    KNAME      PKNAME    TRAN   TYPE FSTYPE        SIZE MOUNTPOINT
/dev/loop0              /dev/loop0                  loop squashfs     97,8M /snap/core/10185
/dev/loop1              /dev/loop1                  loop squashfs     97,9M /snap/core/10444
/dev/loop2              /dev/loop2                  loop squashfs     55,4M /snap/core18/1944
/dev/loop3              /dev/loop3                  loop squashfs     55,4M /snap/core18/1932
/dev/loop4              /dev/loop4                  loop squashfs     31,1M /snap/snapd/10238
/dev/loop5              /dev/loop5                  loop squashfs    125,9M /snap/docker/471
/dev/loop6              /dev/loop6                  loop squashfs     31,1M /snap/snapd/10492
/dev/loop7              /dev/loop7                  loop squashfs     70,6M /snap/lxd/16922
/dev/loop8              /dev/loop8                  loop squashfs     67,8M /snap/lxd/18150
/dev/sda                /dev/sda             usb    disk crypto_LUKS   2,7T 
/dev/sdb                /dev/sdb             sata   disk             931,5G 
|-/dev/sdb1             /dev/sdb1  /dev/sdb         part vfat          512M /boot/efi
|-/dev/sdb2             /dev/sdb2  /dev/sdb         part ext4         1000M /boot
`-/dev/sdb3             /dev/sdb3  /dev/sdb         part LVM2_member   930G 
  `-/dev/mapper/vg0-lv0 /dev/dm-0  /dev/sdb3        lvm  ext4          910G /
/dev/sdc                /dev/sdc             usb    disk               7,3T 
`-/dev/sdc1             /dev/sdc1  /dev/sdc         part crypto_LUKS   7,3T
  • Description of the issue (ideally so that others can reproduce it):
1) install rear, create /etc/rear/site.conf with GRUB_RESCUE=y setting.
2) run sudo -v mkrescue (output and log in attachments)
3) boot and try to select rear from grub menu

Grub menu does not contain rear -option. When I compare this machine's /etc/grub.d contents to another
Ubuntu 20 machine's installation where rear is also installed with GRUB_RESCUE=y setting,
I noticed that in this machine there is no /etc/grub.d/45_rear -file or any other rear files in /etc/grub.d.

gdha commented at 2021-01-08 11:02:

@jk-10 The grub2 entry should be created via script:

2020-12-16 20:16:58.150029606 Including output/default/940_grub2_rescue.sh
2020-12-16 20:16:58.155222676 Setting up GRUB_RESCUE: Adding Relax-and-Recover rescue system to the local GRUB 2 configuration.
2020-12-16 20:16:58.859947262 GRUB2 modules to load: ext2 fat part_gpt
2020-12-16 20:17:20.555943143 Finished GRUB_RESCUE setup: Added 'Relax-and-Recover' GRUB 2 menu entry.

To really know what happens over there re-run rear in debug mode - see the man-page for more help.

CaptainRedHat commented at 2021-03-02 18:48:

I'm also having this same issue on Ubuntu 20.04.2 LTS. I'm on rear version 2.5 / Git installed from the ubuntu software repositories.

Here's the debug log and my site.conf: https://gist.github.com/CaptainRedHat/5a2bc4ba54c09601345634203bf8778a

jsmeix commented at 2021-03-04 15:01:

@CaptainRedHat
your
https://gist.githubusercontent.com/CaptainRedHat/5a2bc4ba54c09601345634203bf8778a/raw/55051d7525a9f923dfe3e4641e91c2038b0869e6/rear-debug-log-03-02-2021-1239.log
contains only

2021-03-02 18:41:36.417777569 Including output/default/940_grub2_rescue.sh
2021-03-02 18:41:36.424064713 Setting up GRUB_RESCUE: Adding Relax-and-Recover rescue system to the local GRUB 2 configuration.
'/tmp/rear.5RyhPHQV567cZPu/tmp/initrd.cgz' -> '/boot/rear-initrd.cgz'
2021-03-02 18:41:36.905450908 Finished GRUB_RESCUE setup: Added 'Relax-and-Recover' GRUB 2 menu entry.

which does not tell the needed details what goes on while this script runs.

What we would need to debug issues is what is asked for in
https://github.com/rear/rear/blob/master/.github/ISSUE_TEMPLATE.md
that reads (excerpt)

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

i.e. the full debugscript mode via -D not only the normal debug mode via -d.

See also the section
"Debugging issues with Relax-and-Recover" in
https://en.opensuse.org/SDB:Disaster_Recovery

CaptainRedHat commented at 2021-03-04 16:24:

Oh sorry, I wasn't sure what all you needed since I didn't open the issue. Here you go:

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"):

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.2 LTS
Release:    20.04
Codename:   focal

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

OUTPUT=ISO
BACKUP=NETFS
BACKUP_URL="nfs://192.168.100.105/data/backups"
GRUB_RESCUE=1
BACKUP_TYPE=incremental
FULLBACKUPDAY="Sun"

Hardware (PC or PowerNV BareMetal or ARM) or virtual machine (KVM guest or PoverVM LPAR): Hardware: Intel PC

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

Firmware (BIOS or UEFI or Open Firmware) and bootloader (GRUB or ELILO or Petitboot): UEFI / GRUB2, version 2.04-1ubuntu26.9

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

Storage layout ("lsblk -ipo NAME,KNAME,PKNAME,TRAN,TYPE,FSTYPE,SIZE,MOUNTPOINT" or "lsblk" as makeshift):

NAME                        KNAME         PKNAME        TRAN   TYPE FSTYPE   SIZE MOUNTPOINT
/dev/sda                    /dev/sda                    sata   disk          1.8T 
`-/dev/sda1                 /dev/sda1     /dev/sda             part LVM2_m   1.8T 
  `-/dev/mapper/vgdata-lvol1
                            /dev/dm-1     /dev/sda1            lvm  xfs      1.8T /opt/docker
/dev/nvme0n1                /dev/nvme0n1                nvme   disk        238.5G 
|-/dev/nvme0n1p1            /dev/nvme0n1p1
|                                         /dev/nvme0n1  nvme   part vfat     512M /boot/efi
|-/dev/nvme0n1p2            /dev/nvme0n1p2
|                                         /dev/nvme0n1  nvme   part ext4       1G /boot
`-/dev/nvme0n1p3            /dev/nvme0n1p3
                                          /dev/nvme0n1  nvme   part LVM2_m   237G 
  `-/dev/mapper/vgsys00-lvol1
                            /dev/dm-0     /dev/nvme0n1p3
                                                               lvm  ext4     237G /

Description of the issue (ideally so that others can reproduce it): Grub menu doesn't contain rear entry although site.conf contains GRUB_RESCUE=1

Workaround, if any: N/A

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

github-actions commented at 2021-05-04 02:25:

Stale issue message

gdha commented at 2021-05-04 07:44:

@jk-10 The entry has been created and can be found as follow (on VirtualBox emulation of an Ubuntu20):
image

image

image

jsmeix commented at 2021-05-04 10:25:

@gdha
thank you for your explanatory
https://github.com/rear/rear/issues/2545#issuecomment-831746535

I think I understand now the root cause of this issue:
I think the root cause are misleading user messages
in case of GRUB_RESCUE setup with UEFI.

In case of GRUB_RESCUE setup with UEFI the LogPrint messages
in output/default/940_grub2_rescue.sh are basically

Setting up GRUB_RESCUE: Adding Relax-and-Recover rescue system to the local GRUB 2 configuration.
...
Finished GRUB_RESCUE setup: Added 'Relax-and-Recover' GRUB 2 menu entry.

so the user expects a 'Relax-and-Recover' GRUB 2 menu entry
but the UEFI "Relax-and-Recover" boot entry motivation explanation comment
in output/default/940_grub2_rescue.sh tells

If UEFI boot is in use, we will not modify grub.cfg,
but setup "Relax-and-Recover" entry in UEFI boot menu instead.

https://github.com/rear/rear/blob/master/usr/share/rear/output/default/940_grub2_rescue.sh
so what the user actually gets is no 'Relax-and-Recover' GRUB 2 menu entry
but a 'Relax-and-Recover' UEFI boot menu entry, see also
https://github.com/rear/rear/pull/954

My https://github.com/rear/rear/pull/2609 intends to fix that.
@gdha @gozora
I would much appreciate it if you could have a closer look
and ideally review (perhaps even test) my pull request changes.

CaptainRedHat commented at 2021-05-08 06:16:

Hi,

As a user, I don't understand why you'd add an entry to the UEFI boot menu and not the grub menu when GRUB_RESCUE=1 is set. GRUB_RESCUE=1 should add an entry to the Grub menu and nothing else. If a user wanted to add an entry to the UEFI boot menu, then there should be a separate setting called UEFI_RESCUE=1 or something like that. Additionally, I'd like to provide a user experience perspective. I have multiple systems, some running UEFI, while others are old BIOS systems. Trying to keep track of which are which is hard enough, but when you also add trying to remember what the boot menu key is on each of those UEFI systems, it feels like a pretty rough user experience, especially when you're trying to recover a production system under pressure. From my perspective, it's a lot easier to just set a grub timeout and be able to select ReaR from the grub menu, regardless of what hardware the system is running on. Just my .02.

gdha commented at 2021-05-08 09:34:

@CaptainRedHat I tend to agree with your comments, therefore, I've added the "needs sponsorship" flag. Who has time to pick this one up?

jsmeix commented at 2021-05-11 10:18:

With https://github.com/rear/rear/pull/2609 merged
there is now at least a better description in default.conf
how GRUB_RESCUE with UEFI and GRUB2 currently works
and in output/default/940_grub2_rescue.sh there is better error checking
plus some alignment with how create_grub2_cfg() creates a GRUB2 config file.

jsmeix commented at 2021-05-11 10:34:

@CaptainRedHat
in general regarding what you don't understand read the description
UEFI 'Relax-and-Recover' boot entry motivation
in usr/share/rear/output/default/940_grub2_rescue.sh
https://github.com/rear/rear/blob/master/usr/share/rear/output/default/940_grub2_rescue.sh
that explains why

If UEFI boot is in use, we will not modify grub.cfg,
but setup 'Relax-and-Recover' entry in UEFI boot menu instead

from the point of view who implemented the current code.
We are very grateful for his many various actual contributions to ReaR
(otherwise there would be in particular no GRUB_RESCUE with UEFI).

Now we look forward to your pull request that provides what you ask for,
cf. https://en.wikipedia.org/wiki/Linus%27s_law

Given a large enough beta-tester and co-developer base,
almost every problem will be characterized quickly
and the fix obvious to someone.

github-actions commented at 2021-07-11 02:11:

Stale issue message


[Export of Github issue for rear/rear.]