#3257 Issue closed: OUTPUT option to only have a grub/efi entry but no ISO?

Labels: support / question, ready-to-close?

damm620 opened issue at 2024-06-19 07:47:

  • ReaR version ("/usr/sbin/rear -V"):
    2.7

Currently the have the following parameter configured:

OUTPUT=ISO
BACKUP=TSM

This creates the iso as well as the grub/efi entry.
So fine, so good.

On certain systems we want to disable the iso creation.
How can we achieve this?

gdha commented at 2024-07-01 14:14:

@damm620 not sure what you are trying to achieve? Perhaps, OUTPUT_URL=null could help?

damm620 commented at 2024-07-01 14:30:

I will try this in the coming days, thank you :)

We do not want to have a EFI entry in places where we cannot access it (e.g. VM in Azure cloud)

damm620 commented at 2024-07-09 08:53:

nope, with OUTPUT_URL=null the ISO will still be created:

Click to expand [root@SERVERNAME ~]# cat /etc/rear/site.conf OUTPUT=ISO # Creates an ISO file - other e.g. RAMDISK BACKUP=TSM # Backup/Restore method - other e.g. rsync COPY_AS_IS_TSM=( "/etc/adsm/ /opt/tivoli/tsm/client /usr/local/ibm/gsk8* /SZIR/data/inclexcl2 /SZIR/data/dsm.sys /SZIR/data/dsm.opt" ) # Files which should be in the ISO # Skip language files to reduce the ISO size COPY_AS_IS_EXCLUDE_TSM=( "/opt/tivoli/tsm/client/ba/bin/ZH_CN/*" "/opt/tivoli/tsm/client/ba/bin/ZH_TW/*" "/opt/tivoli/tsm/client/ba/bin/IT_IT/*" "/opt/tivoli/tsm/client/ba/bin/CS_CZ/*" "/opt/tivoli/tsm/client/ba/bin/ES_ES*" "/opt/tivoli/tsm/client/ba/bin/FR_FR/*" "/opt/tivoli/tsm/client/ba/bin/HU_HU/*" "/opt/tivoli/tsm/client/ba/bin/KO_KR/*" "/opt/tivoli/tsm/client/ba/bin/PL_PL/*" "/opt/tivoli/tsm/client/ba/bin/PT_BR/*" "/opt/tivoli/tsm/client/ba/bin/JA_JP/*" "/opt/tivoli/tsm/client/ba/bin/RU_RU/*" "/opt/tivoli/tsm/client/ba/bin/plugins/*" "/opt/tivoli/tsm/client/api/bin64/CS_CZ*" "/opt/tivoli/tsm/client/api/bin64/DE_DE/*" "/opt/tivoli/tsm/client/api/bin64/dsmenc" "/opt/tivoli/tsm/client/api/bin64/dsm.opt.smp" "/opt/tivoli/tsm/client/api/bin64/dsm.sys.smp" "/opt/tivoli/tsm/client/api/bin64/dsmtca" "/opt/tivoli/tsm/client/api/bin64/EN_US" "/opt/tivoli/tsm/client/api/bin64/ES_ES" "/opt/tivoli/tsm/client/api/bin64/FR_FR" "/opt/tivoli/tsm/client/api/bin64/HU_HU" "/opt/tivoli/tsm/client/api/bin64/IT_IT" "/opt/tivoli/tsm/client/api/bin64/JA_JP" "/opt/tivoli/tsm/client/api/bin64/KO_KR" "/opt/tivoli/tsm/client/api/bin64/PL_PL" "/opt/tivoli/tsm/client/api/bin64/PT_BR" "/opt/tivoli/tsm/client/api/bin64/RU_RU" "/opt/tivoli/tsm/client/api/bin64/sample" "/opt/tivoli/tsm/client/api/bin64/ZH_CN" "/opt/tivoli/tsm/client/api/bin64/ZH_TW" ) ONLY_INCLUDE_VG=("vg00") # Only the OS will be restored. Customer volumegroups/FS vg01/IMAPL/evg01 aren't restored CHECK_CONFIG_FILES=( '/etc/adsm/' '/etc/drbd/' '/etc/drbd.conf' '/etc/lvm/lvm.conf' '/etc/multipath.conf' '/etc/rear/' '/etc/udev/udev.conf' '/opt/tivoli/tsm/client/ba/bin/dsmc' ) PROGS_TSM=(dsmc) PROGS=( ${PROGS[@]} "vconfig vi vim" ) NON_FATAL_BINARIES_WITH_MISSING_LIBRARY=("/opt/tivoli/tsm/client/*|/usr/local/ibm/gsk8_64/bin/") GRUB_RESCUE=y AUTOEXCLUDE_MULTIPATH=y # Default Wert=y - multipath devices are not created/saved. Which is usually not necessary # If these must be restored nevertheless e.g. "rm -rf /". The restore must be performed manually afterwards TSM_RESULT_SAVE=n # Don't save ISO in TSM KEEP_BUILD_DIR=n # Remove build directory (dir in /tmp) in any case to prevent full filesystem USER_INPUT_TIMEOUT=900 # Increase timeout for user input from 5 to 15 minutes USE_DHCLIENT="n" REAR_INITRD_COMPRESSION="lzma" OUTPUT_URL=null [root@SERVERNAME ~]# ll /var/lib/rear/output/*.iso /boot/rear* ls: cannot access '/var/lib/rear/output/*.iso': No such file or directory ls: cannot access '/boot/rear*': No such file or directory [root@SERVERNAME ~]# TEMPDIR=/tmp rear -D mkrescue; echo $? Relax-and-Recover 2.7 / Git Running rear mkrescue (PID 778797 date 2024-07-09 10:40:48) Command line options: /usr/sbin/rear -D mkrescue Using log file: /var/log/rear/rear-SERVERNAME.log Using build area: /var/tmp/rear.n3dB0Y5BFrG1DSc Running 'init' stage ====================== Running workflow mkrescue on the normal/original system Running 'prep' stage ====================== Using '/bin/xorrisofs' to create ISO filesystem images Using autodetected kernel '/boot/vmlinuz-5.14.0-472.el9.x86_64' as kernel in the recovery system Running 'layout/save' stage ====================== Creating disk layout Overwriting existing disk layout file /var/lib/rear/layout/disklayout.conf Disabling excluded components in /var/lib/rear/layout/disklayout.conf Using guessed bootloader 'GRUB' for 'rear recover' (found in first bytes on /dev/sda) Verifying that the entries in /var/lib/rear/layout/disklayout.conf are correct Created disk layout (check the results in /var/lib/rear/layout/disklayout.conf) Running 'rescue' stage ====================== Creating recovery system root filesystem skeleton layout Adding biosdevname=0 to KERNEL_CMDLINE Adding net.ifnames=0 to KERNEL_CMDLINE Skipping 'docker0': not bound to any physical interface. Handling network interface 'eth0' eth0 is a physical device Handled network interface 'eth0' Handling network interface 'eth1' eth1 is a physical device Handled network interface 'eth1' Included current keyboard mapping (via 'dumpkeys -f') Included default US keyboard mapping /lib/kbd/keymaps/legacy/i386/qwerty/defkeymap.map.gz Included other keyboard mappings in /lib/kbd/keymaps Copying logfile /var/log/rear/rear-SERVERNAME.log into initramfs as '/tmp/rear-SERVERNAME-partial-2024-07-09T10:40:57+02:00.log' Running 'build' stage ====================== Copying files and directories Copying binaries and libraries Copying all kernel modules in /lib/modules/5.14.0-472.el9.x86_64 (MODULES contains 'all_modules') Failed to copy all contents of /lib/modules/5.14.0-472.el9.x86_64 (dangling symlinks could be a reason) Copying all files in /lib*/firmware/ Skip copying broken symlink '/etc/mtab' target '/proc/792876/mounts' on /proc/ /sys/ /dev/ or /run/ Testing that the recovery system in /var/tmp/rear.n3dB0Y5BFrG1DSc/rootfs contains a usable system Testing each binary with 'ldd' and look for 'not found' libraries within the recovery system /usr/lib64/systemd/libsystemd-core-252.so requires additional libraries libsystemd-shared-252.so => not found ReaR recovery system in '/var/tmp/rear.n3dB0Y5BFrG1DSc/rootfs' needs additional libraries, check /var/log/rear/rear-SERVERNAME.log for details Testing that the existing programs in the PROGS array can be found as executable command within the recovery system Testing that each program in the REQUIRED_PROGS array can be found as executable command within the recovery system Running 'pack' stage ====================== Creating recovery/rescue system initramfs/initrd initrd.xz with xz lzma compression Created initrd.xz with xz lzma compression (601833497 bytes) in 431 seconds Running 'output' stage ====================== Searching whole /usr for SYSLINUX modules directory (you may specify SYSLINUX_MODULES_DIR) Making ISO image Wrote ISO image: /var/lib/rear/output/rear-SERVERNAME.iso (591M) Setting up GRUB_RESCUE: Adding Relax-and-Recover rescue system to the local GRUB 2 configuration Modifying local GRUB 2 configuration Finished GRUB_RESCUE setup: Added 'Relax-and-Recover' GRUB 2 menu entry Exiting rear mkrescue (PID 778797) and its descendant processes ... Running exit tasks 0 [root@SERVERNAME ~]# ll /var/lib/rear/output/*.iso /boot/rear* -rw-r--r-- 1 root root 601833497 Jul 9 10:48 /boot/rear-initrd.xz -rwxr-xr-x 2 root root 14395432 Jun 27 22:23 /boot/rear-kernel -rw------- 1 root root 618760192 Jul 9 10:48 /var/lib/rear/output/rear-SERVERNAME.iso

Does have anyone have any other idea?

gdha commented at 2024-07-09 09:18:

@damm620 The OUTPUT_URL=null will not upload the ISO to TSM I believe. However, when you do not want an ISO how will you ever recover? I guess you want the ISO to be saved on TSM, right? And, not have a local copy of the ISO?
Then remove the OUTPUT_URL=null line and add for example:

POST_BACKUP_SCRIPT=("rm -f  /var/lib/rear/output/rear-$HOSTNAME.iso")

but then you will need to run rear -v mkbackup

schlomo commented at 2024-07-11 16:11:

@damm620 without creating an ISO, how do you plan to boot the system into the rescue system? OUTPUT should then reflect what you want to use for rescue booting.

Did you maybe also set GRUB_RESCUE=y without mentioning in the issue description?

Have you tried setting OUTPUT=TSM? I'd imagine that it disables creating an output whatsoever, as a side effect

Have you tried setting OUTPUT=RAMDISK?

With OUTPUT=RAMDISK the ReaR rescue/recovery system initramfs/initrd is created but nothing additional is done to make it bootable.

I'd guess that this is what you meant.

damm620 commented at 2024-07-16 07:13:

@damm620 without creating an ISO, how do you plan to boot the system into the rescue system? OUTPUT should then reflect what you want to use for rescue booting.

Did you maybe also set GRUB_RESCUE=y without mentioning in the issue description?

Have you tried setting OUTPUT=TSM? I'd imagine that it disables creating an output whatsoever, as a side effect

Have you tried setting OUTPUT=RAMDISK?

With OUTPUT=RAMDISK the ReaR rescue/recovery system initramfs/initrd is created but nothing additional is done to make it bootable.

I'd guess that this is what you meant.

Yes GRUB_RESCUE=y is configured.
I want to have a bootable grub/EFI entry but no ISO file (because on certain platforms we cannot boot from it).

So, a mixture of

GRUB_RESCUE=y
OUTPUT=RAMDISK
BACKUP=TSM

should do the trick? Having a bootable bootentry, but no ISO?

gdha commented at 2024-09-05 08:40:

@damm620 Have you tried below settings?

GRUB_RESCUE=y
OUTPUT=RAMDISK
BACKUP=TSM

Could you give us an update please?

damm620 commented at 2024-09-09 06:09:

Hi @gdha,

sorry, I was busy the last weeks. Thanks for the reminder.
It looks like that config do the trick:

config:

[root@SERVERNAME ~]# grep -i -e grub -e outp -e backup /etc/rear/site.conf |grep -v ^#
GRUB_RESCUE=y
OUTPUT=RAMDISK
BACKUP=TSM

state before:

[root@SERVERNAME ~]# ll /var/lib/rear/output/rear-SERVERNAME.iso; grep rear /boot/grub2/grub*
ls: cannot access '/var/lib/rear/output/rear-SERVERNAME.iso': No such file or directory
/boot/grub2/grub.cfg:### BEGIN /etc/grub.d/45_rear ###
/boot/grub2/grub.cfg:          echo 'Loading kernel /boot/rear-kernel ...'
/boot/grub2/grub.cfg:          linux /rear-kernel root=/dev/ram0 vga=normal rw  selinux=0 biosdevname=0 net.ifnames=0
/boot/grub2/grub.cfg:          echo 'Loading initrd /boot/rear-initrd.cgz (may take a while) ...'
/boot/grub2/grub.cfg:          initrd /rear-initrd.cgz
/boot/grub2/grub.cfg:### END /etc/grub.d/45_rear ###

[root@SERVERNAME ~]# echo " " > /etc/grub.d/45_rear
[root@SERVERNAME ~]# ll /var/lib/rear/output/rear-SERVERNAME.iso; cat /etc/grub.d/45_rear
ls: cannot access '/var/lib/rear/output/rear-SERVERNAME.iso': No such file or directory

mkrescue:

[root@SERVERNAME ~]# TMPDIR=/tmp /usr/sbin/rear -d mkrescue
Relax-and-Recover 2.7 / Git
Running rear mkrescue (PID 2320 date 2024-09-09 08:02:10)
Command line options: /usr/sbin/rear -d mkrescue
Using log file: /var/log/rear/rear-SERVERNAME.log
Using build area: /tmp/rear.tiVl6sAuhzQaDdu
Running 'init' stage ======================
Running workflow mkrescue on the normal/original system
Running 'prep' stage ======================
Using autodetected kernel '/boot/vmlinuz-5.14.0-503.el9.x86_64' as kernel in the recovery system
Running 'layout/save' stage ======================
Creating disk layout
Overwriting existing disk layout file /var/lib/rear/layout/disklayout.conf
Excluding component /dev/mapper/vg00-snap_dummy_lv_vg00 in EXCLUDE_COMPONENTS
Excluding component /dev/mapper/evg00-snap_dummy_lv_evg00 in EXCLUDE_COMPONENTS
Disabling excluded components in /var/lib/rear/layout/disklayout.conf
Using guessed bootloader 'GRUB' for 'rear recover' (found in first bytes on /dev/sda)
Verifying that the entries in /var/lib/rear/layout/disklayout.conf are correct
Created disk layout (check the results in /var/lib/rear/layout/disklayout.conf)
Running 'rescue' stage ======================
Creating recovery system root filesystem skeleton layout
Adding biosdevname=0 to KERNEL_CMDLINE
Adding net.ifnames=0 to KERNEL_CMDLINE
Handling network interface 'eth0'
eth0 is a physical device
Handled network interface 'eth0'
Handling network interface 'eth1'
eth1 is a physical device
Handled network interface 'eth1'
Skipping 'lo': not bound to any physical interface.
Included current keyboard mapping (via 'dumpkeys -f')
Included default US keyboard mapping /lib/kbd/keymaps/legacy/i386/qwerty/defkeymap.map.gz
Included other keyboard mappings in /lib/kbd/keymaps
Copying logfile /var/log/rear/rear-SERVERNAME.log into initramfs as '/tmp/rear-SERVERNAME-partial-2024-09-09T08:02:16+02:00.log'
Running 'build' stage ======================
Copying files and directories
Copying binaries and libraries
Copying all kernel modules in /lib/modules/5.14.0-503.el9.x86_64 (MODULES contains 'all_modules')
Failed to copy all contents of /lib/modules/5.14.0-503.el9.x86_64 (dangling symlinks could be a reason)
Copying files from /lib*/firmware/ that match *amd/* *intel* *tigon* *bnx2* *ql2* *cxgb* *renesas_usb*
Skip copying broken symlink '/etc/mtab' target '/proc/14890/mounts' on /proc/ /sys/ /dev/ or /run/
Testing that the recovery system in /tmp/rear.tiVl6sAuhzQaDdu/rootfs contains a usable system
Testing each binary with 'ldd' and look for 'not found' libraries within the recovery system
/usr/lib64/systemd/libsystemd-core-252.so requires additional libraries
        libsystemd-shared-252.so => not found
ReaR recovery system in '/tmp/rear.tiVl6sAuhzQaDdu/rootfs' needs additional libraries, check /var/log/rear/rear-SERVERNAME.log for details
Testing that the existing programs in the PROGS array can be found as executable command within the recovery system
Testing that each program in the REQUIRED_PROGS array can be found as executable command within the recovery system
Running 'pack' stage ======================
Creating recovery/rescue system initramfs/initrd initrd.cgz with gzip default compression
Created initrd.cgz with gzip default compression (293791753 bytes) in 29 seconds
Running 'output' stage ======================
Adding /tmp/rear.tiVl6sAuhzQaDdu/tmp/kernel-SERVERNAME and /tmp/rear.tiVl6sAuhzQaDdu/tmp/initramfs-SERVERNAME.img to RESULT_FILES
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
Exiting rear mkrescue (PID 2320) and its descendant processes ...
Running exit tasks

state after:

[root@SERVERNAME ~]# ll /var/lib/rear/output/rear-SERVERNAME.iso; cat /etc/grub.d/45_rear
ls: cannot access '/var/lib/rear/output/rear-SERVERNAME.iso': No such file or directory
#!/bin/bash
cat << EOF
menuentry 'Relax-and-Recover' --class os {
          search --no-floppy --fs-uuid --set=root 24c1f91a-a1ca-4f42-8d02-313f12fadc0e
          echo 'Loading kernel /boot/rear-kernel ...'
          linux /rear-kernel root=/dev/ram0 vga=normal rw  selinux=0 biosdevname=0 net.ifnames=0
          echo 'Loading initrd /boot/rear-initrd.cgz (may take a while) ...'
          initrd /rear-initrd.cgz
}
EOF

Did I overlook anything or does this config creates NO ISO, but it creates a bootable initrd?

gdha commented at 2024-09-09 06:51:

@damm620 Indeed "Added 'Relax-and-Recover' GRUB 2 menu entry" worked as expected. No ISO made as well. You can now perform a test on your system to boot up with the new ReaR Grub entry. Just do a boot up test and see if the ReaR recovery image looks sane to you. Do not perform a recovery test on your system. If you want to test it out just use a system which can be missed ;-)

damm620 commented at 2024-09-09 07:47:

@damm620 Indeed "Added 'Relax-and-Recover' GRUB 2 menu entry" worked as expected. No ISO made as well. You can now perform a test on your system to boot up with the new ReaR Grub entry. Just do a boot up test and see if the ReaR recovery image looks sane to you. Do not perform a recovery test on your system. If you want to test it out just use a system which can be missed ;-)

I already did boot via grub into the rear env. And it worked ;)

damm620 commented at 2024-09-11 06:31:

I also like to add that this config also worked for UEFI servers:

config:

[root@SERVERNAME ~]# grep -i -e grub -e outp -e backup /etc/rear/site.conf |grep -v ^#
GRUB_RESCUE=y
OUTPUT=RAMDISK
BACKUP=TSM

state before:

[root@SERVERNAME ~]# ll /var/lib/rear/output/rear-SERVERNAME.iso; efibootmgr
ls: cannot access '/var/lib/rear/output/rear-SERVERNAME.iso': No such file or directory
BootCurrent: 0001
Timeout: 0 seconds
BootOrder: 0001,0002,0000,0003
Boot0000* UiApp
Boot0001* UEFI PXEv4 (MAC:020017145C0D)
Boot0002* UEFI PXEv4 (MAC:020017145C0D) 2
Boot0003* EFI Internal Shell

mkrescue:

[root@SERVERNAME ~]# TMPDIR=/tmp /usr/sbin/rear -d mkrescue
Relax-and-Recover 2.7 / Git
Running rear mkrescue (PID 695882 date 2024-09-11 08:28:56)
Command line options: /usr/sbin/rear -d mkrescue
Using log file: /var/log/rear/rear-SERVERNAME.log
Using build area: /tmp/rear.Sve65ggTDIzb3ve
Running 'init' stage ======================
Running workflow mkrescue on the normal/original system
Running 'prep' stage ======================
Found EFI system partition /dev/sda1 on /boot/efi type vfat
Using UEFI Boot Loader for Linux (USING_UEFI_BOOTLOADER=1)
Using autodetected kernel '/boot/vmlinuz-5.14.0-427.33.1.el9_4.x86_64' as kernel in the recovery system
Running 'layout/save' stage ======================
Creating disk layout
Overwriting existing disk layout file /var/lib/rear/layout/disklayout.conf
Disabling excluded components in /var/lib/rear/layout/disklayout.conf
Using guessed bootloader 'EFI' for 'rear recover' (found in first bytes on /dev/sda)
Verifying that the entries in /var/lib/rear/layout/disklayout.conf are correct
Created disk layout (check the results in /var/lib/rear/layout/disklayout.conf)
Running 'rescue' stage ======================
Creating recovery system root filesystem skeleton layout
Adding net.ifnames=0 to KERNEL_CMDLINE
Adding biosdevname=0 to KERNEL_CMDLINE
Handling network interface 'eth0'
eth0 is a physical device
Handled network interface 'eth0'
Skipping 'lo': not bound to any physical interface.
Included current keyboard mapping (via 'dumpkeys -f')
Included default US keyboard mapping /lib/kbd/keymaps/legacy/i386/qwerty/defkeymap.map.gz
Included other keyboard mappings in /lib/kbd/keymaps
Trying to find what to use as UEFI bootloader...
Trying to find a 'well known file' to be used as UEFI bootloader...
Using '/boot/efi/EFI/redhat/grubx64.efi' as UEFI bootloader file
Copying logfile /var/log/rear/rear-SERVERNAME.log into initramfs as '/tmp/rear-SERVERNAME-partial-2024-09-11T08:29:01+02:00.log'
Running 'build' stage ======================
Copying files and directories
Copying binaries and libraries
Copying all kernel modules in /lib/modules/5.14.0-427.33.1.el9_4.x86_64 (MODULES contains 'all_modules')
Failed to copy all contents of /lib/modules/5.14.0-427.33.1.el9_4.x86_64 (dangling symlinks could be a reason)
Copying files from /lib*/firmware/ that match *amd/* *intel* *tigon* *bnx2* *ql2* *cxgb* *renesas_usb*
Skip copying broken symlink '/etc/mtab' target '/proc/708072/mounts' on /proc/ /sys/ /dev/ or /run/
Testing that the recovery system in /tmp/rear.Sve65ggTDIzb3ve/rootfs contains a usable system
Testing each binary with 'ldd' and look for 'not found' libraries within the recovery system
/usr/lib64/systemd/libsystemd-core-252.so requires additional libraries
        libsystemd-shared-252.so => not found
ReaR recovery system in '/tmp/rear.Sve65ggTDIzb3ve/rootfs' needs additional libraries, check /var/log/rear/rear-SERVERNAME.log for details
Testing that the existing programs in the PROGS array can be found as executable command within the recovery system
Testing that each program in the REQUIRED_PROGS array can be found as executable command within the recovery system
Running 'pack' stage ======================
Creating recovery/rescue system initramfs/initrd initrd.cgz with gzip default compression
Created initrd.cgz with gzip default compression (312698486 bytes) in 27 seconds
Running 'output' stage ======================
Adding /tmp/rear.Sve65ggTDIzb3ve/tmp/kernel-SERVERNAME and /tmp/rear.Sve65ggTDIzb3ve/tmp/initramfs-SERVERNAME.img to RESULT_FILES
Setting up GRUB_RESCUE: Adding Relax-and-Recover rescue system to the local UEFI boot manager
Anyone who can select UEFI boot entries can boot it and replace the current system via 'rear recover'
GRUB2 modules to load: fat part_gpt part_msdos xfs
Finished GRUB_RESCUE setup: Added 'Relax-and-Recover' UEFI boot manager entry
Exiting rear mkrescue (PID 695882) and its descendant processes ...
Running exit tasks

state after:

[root@SERVERNAME ~]# ll /var/lib/rear/output/rear-SERVERNAME.iso; efibootmgr
ls: cannot access '/var/lib/rear/output/rear-SERVERNAME.iso': No such file or directory
BootCurrent: 0001
Timeout: 0 seconds
BootOrder: 0001,0002,0000,0003,0004
Boot0000* UiApp
Boot0001* UEFI PXEv4 (MAC:020017145C0D)
Boot0002* UEFI PXEv4 (MAC:020017145C0D) 2
Boot0003* EFI Internal Shell
Boot0004* Relax-and-Recover

[Export of Github issue for rear/rear.]