#1738 Issue closed: rear mkrescue to USB stick fails when OUTPUT_URL is defined

Labels: enhancement, documentation, minor bug, no-issue-activity

ritzmann opened issue at 2018-02-24 18:13:

  • rear version (/usr/sbin/rear -V): Relax-and-Recover 2.3 / 2017-12-20
  • OS version (cat /etc/rear/os.conf or lsb_release -a): Debian GNU/Linux 8.10 (jessie)
  • rear configuration files (cat /etc/rear/site.conf or cat /etc/rear/local.conf):
    OUTPUT_URL=file:///var/lib/backuppc/rear/output/
    OUTPUT=USB
    USB_DEVICE=/dev/disk/by-label/REAR-000
    USB_DEVICE_FILESYSTEM=ext4
    BACKUP=REQUESTRESTORE
    TIMESYNC=NTP
  • Are you using legacy BIOS or UEFI boot? BIOS
  • Brief description of the issue:
    rear -v mkrescue fails like this:
$ sudo rear -v mkrescue                                                                                                                                                     
Relax-and-Recover 2.3 / 2017-12-20
Using log file: /var/log/rear/rear-drossel.log
Creating disk layout
Using guessed bootloader 'GRUB'
Creating root filesystem layout
To log into the recovery system via ssh set up /root/.ssh/authorized_keys or specify SSH_ROOT_PASSWORD
Copying logfile /var/log/rear/rear-drossel.log into initramfs as '/tmp/rear-drossel-partial-2018-02-24T20:01:49+0200.log'
Copying files and directories
Copying binaries and libraries
Copying kernel modules
Copying all files in /lib*/firmware/
Creating recovery/rescue system initramfs/initrd initrd.cgz with gzip default compression
Created initrd.cgz with gzip default compression (79344434 bytes) in 10 seconds
Saved /var/log/rear/rear-drossel.log as rear/drossel/20180224.2001/rear-drossel.log
ERROR: 
====================
BUG in /usr/share/rear/output/USB/Linux-i386/850_make_USB_bootable.sh line 40:
'Filesystem for device '/dev/sdl1' could not be found'
--------------------
Please report this issue at https://github.com/rear/rear/issues
and include the relevant parts from /var/log/rear/rear-drossel.log
preferably with full debug information via 'rear -d -D mkrescue'
====================
Aborting due to an error, check /var/log/rear/rear-drossel.log for details

Here is the tail of the log file:

2018-02-24 20:08:11.653722382 ======================
2018-02-24 20:08:11.656483136 Running 'output' stage
2018-02-24 20:08:11.659023446 ======================
2018-02-24 20:08:11.675952265 Including output/default/010_set_umask.sh
2018-02-24 20:08:11.677958333 Setting umask to 077
2018-02-24 20:08:11.684085510 Including output/USB/Linux-i386/100_create_efiboot.sh
2018-02-24 20:08:11.690320730 Including output/default/100_mount_output_path.sh
mkdir: created directory '/tmp/rear.J5Id8g1KUQXTKNF/outputfs'
2018-02-24 20:08:11.704637082 Including output/default/150_save_copy_of_prefix_dir.sh
2018-02-24 20:08:11.709622638 Including output/default/200_make_boot_dir.sh
mkdir: created directory '/tmp/rear.J5Id8g1KUQXTKNF/tmp/boot'
2018-02-24 20:08:11.717503747 Including output/default/200_make_prefix_dir.sh
2018-02-24 20:08:11.735323228 Including output/default/250_create_lock.sh
2018-02-24 20:08:11.756192413 Including output/USB/Linux-i386/300_create_extlinux.sh
2018-02-24 20:08:11.767879858 USB syslinux version: 
2018-02-24 20:08:11.769883669 System syslinux version: 6.03
2018-02-24 20:08:11.781817621 Features based on syslinux version: 6.03
2018-02-24 20:08:11.810800723 Using syslinux prefix: boot/syslinux
2018-02-24 20:08:11.816680706 Creating rear/drossel/20180224.2007/syslinux.cfg
2018-02-24 20:08:11.834197699 Creating /rear/syslinux.cfg
2018-02-24 20:08:11.850140127 Processing rear/drossel/20180224.2007/syslinux.cfg
2018-02-24 20:08:11.867229356 Creating boot/syslinux/extlinux.conf
'/usr/lib/syslinux/modules/bios/cat.c32' -> '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/cat.c32'
'/usr/lib/syslinux/modules/bios/config.c32' -> '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/config.c32'
'/usr/lib/syslinux/modules/bios/cmd.c32' -> '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/cmd.c32'
'/usr/lib/syslinux/modules/bios/cpuid.c32' -> '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/cpuid.c32'
'/usr/lib/syslinux/modules/bios/disk.c32' -> '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/disk.c32'
'/usr/lib/syslinux/modules/bios/host.c32' -> '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/host.c32'
'/usr/lib/syslinux/modules/bios/kbdmap.c32' -> '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/kbdmap.c32'
'/usr/lib/syslinux/modules/bios/ls.c32' -> '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/ls.c32'
'/usr/lib/syslinux/modules/bios/lua.c32' -> '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/lua.c32'
'/usr/lib/syslinux/modules/bios/rosh.c32' -> '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/rosh.c32'
'/usr/lib/syslinux/modules/bios/sysdump.c32' -> '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/sysdump.c32'
'/usr/lib/syslinux/modules/bios/vesamenu.c32' -> '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/vesamenu.c32'
'/usr/lib/syslinux/modules/bios/ldlinux.c32' -> '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/ldlinux.c32'
'/usr/lib/syslinux/modules/bios/libcom32.c32' -> '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/libcom32.c32'
'/usr/lib/syslinux/modules/bios/libgpl.c32' -> '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/libgpl.c32'
'/usr/lib/syslinux/modules/bios/libmenu.c32' -> '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/libmenu.c32'
'/usr/lib/syslinux/modules/bios/libutil.c32' -> '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/libutil.c32'
'/usr/lib/syslinux/modules/bios/menu.c32' -> '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/menu.c32'
'/usr/lib/syslinux/modules/bios/chain.c32' -> '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/chain.c32'
'/usr/lib/syslinux/modules/bios/hdt.c32' -> '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/hdt.c32'
'/usr/lib/syslinux/modules/bios/reboot.c32' -> '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/reboot.c32'
2018-02-24 20:08:11.970410985 Created extlinux configuration 'boot/syslinux/extlinux.conf'
2018-02-24 20:08:11.976203287 Including output/default/400_copy_disk_struct_files.sh
2018-02-24 20:08:11.981665977 Including output/USB/Linux-i386/830_copy_kernel_initrd.sh
'/boot/vmlinuz-3.16.0-5-amd64' -> '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/rear/drossel/20180224.2007/kernel'
'/tmp/rear.J5Id8g1KUQXTKNF/tmp/initrd.cgz' -> '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/rear/drossel/20180224.2007/initrd.cgz'
2018-02-24 20:08:12.066440187 Copied kernel and initrd.cgz to rear/drossel/20180224.2007
2018-02-24 20:08:12.077147799 Saved /var/log/rear/rear-drossel.log as rear/drossel/20180224.2007/rear-drossel.log
2018-02-24 20:08:12.083747745 Including output/USB/Linux-i386/850_make_USB_bootable.sh
2018-02-24 20:08:12.113976273 ERROR: 
====================
BUG in /usr/share/rear/output/USB/Linux-i386/850_make_USB_bootable.sh line 40:
'Filesystem for device '/dev/sdl1' could not be found'
--------------------
Please report this issue at https://github.com/rear/rear/issues
and include the relevant parts from /var/log/rear/rear-drossel.log
preferably with full debug information via 'rear -d -D mkrescue'
====================
==== Stack trace ====
Trace 0: /usr/sbin/rear:543 main
Trace 1: /usr/share/rear/lib/mkrescue-workflow.sh:22 WORKFLOW_mkrescue
Trace 2: /usr/share/rear/lib/framework-functions.sh:101 SourceStage
Trace 3: /usr/share/rear/lib/framework-functions.sh:49 Source
Trace 4: /usr/share/rear/output/USB/Linux-i386/850_make_USB_bootable.sh:40 source
Trace 5: /usr/share/rear/lib/_input-output-functions.sh:307 BugError
Message: 
====================
BUG in /usr/share/rear/output/USB/Linux-i386/850_make_USB_bootable.sh line 40:
'Filesystem for device '/dev/sdl1' could not be found'
--------------------
Please report this issue at https://github.com/rear/rear/issues
and include the relevant parts from /var/log/rear/rear-drossel.log
preferably with full debug information via 'rear -d -D mkrescue'
====================
== End stack trace ==
2018-02-24 20:08:12.129988824 Running exit tasks.
removed '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/rear/syslinux.cfg'
removed '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/rear/drossel/20180224.2007/kernel'
removed '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/rear/drossel/20180224.2007/rear-drossel.log'
removed '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/rear/drossel/20180224.2007/syslinux.cfg'
removed '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/rear/drossel/20180224.2007/initrd.cgz'
removed directory: '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/rear/drossel/20180224.2007'
removed directory: '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/rear/drossel'
removed directory: '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/rear'
removed '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/chain.c32'
removed '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/message'
removed '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/libutil.c32'
removed '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/menu.c32'
removed '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/kbdmap.c32'
removed '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/libgpl.c32'
removed '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/host.c32'
removed '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/libmenu.c32'
removed '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/pci.ids'
removed '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/ldlinux.c32'
removed '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/disk.c32'
removed '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/cat.c32'
removed '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/sysdump.c32'
removed '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/config.c32'
removed '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/lua.c32'
removed '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/hdt.c32'
removed '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/ls.c32'
removed '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/libcom32.c32'
removed '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/vesamenu.c32'
removed '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/rear.help'
removed '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/rosh.c32'
removed '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/reboot.c32'
removed '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/cpuid.c32'
removed '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/extlinux.conf'
removed '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux/cmd.c32'
removed directory: '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot/syslinux'
removed directory: '/tmp/rear.J5Id8g1KUQXTKNF/outputfs/boot'
removed directory: '/tmp/rear.J5Id8g1KUQXTKNF/outputfs'
2018-02-24 20:08:12.155750827 Finished in 50 seconds
2018-02-24 20:08:12.159213648 Removing build area /tmp/rear.J5Id8g1KUQXTKNF
removed directory: '/tmp/rear.J5Id8g1KUQXTKNF'
2018-02-24 20:08:12.316348368 End of program reached
  • Work-around, if any:
    Comment out or remove the OUTPUT_URL setting in local.conf.

Since I was experimenting with various options, I was expecting that I could leave irrelevant settings in the config file. However, at least the OUTPUT_URL setting managed to confuse mkrescue when writing to a USB stick. I believe that this is a mistake that especially beginners are likely to make and it would be good if the scripts could handle it more gracefully. It certainly cost me several hours to figure out.

gdha commented at 2018-03-02 12:25:

@ritzmann good point:
OUTPUT_URL=file:///var/lib/backuppc/rear/output/ should not be used in conjunction with
USB_DEVICE=/dev/disk/by-label/REAR-000
I guess we need to write some additional checks here...

Or, perhaps, we should migrate to OUTPUT_URL only style, which makes more sense as we use it for all the rest?

ritzmann commented at 2018-03-02 12:58:

The latter sounds very good to me. Thanks for considering my report.

jsmeix commented at 2018-03-05 11:43:

Currently we have some basic tests related to USB,
see https://github.com/rear/rear/pull/1572 and starting at
https://github.com/rear/rear/issues/1571#issuecomment-343412481
and the subsequent comments therein.

The general problem with OUTPUT=USB is that it behaves in various ways
different (strictly speaking even incompatible) compared to the other ways,
for example see things like USB_SUFFIX in default.conf
and the other GitHub issues mentioned therein.

jsmeix commented at 2018-03-06 08:56:

@ritzmann
regarding your
"I was expecting that I could leave irrelevant settings in the config file":

Of course if a setting is really irrelevant you can have it wherever you like.

But in this case the OUTPUT_URL setting in local.conf is not irrelevant.

In general the various code parts for the various config settings in ReaR
are implemented without special treatment for interdependencies,
except some exceptions for some specific known cases, cf.
https://github.com/rear/rear/issues/1738#issuecomment-370394149

E.g. the code that works with the OUTPUT_URL setting does its job
in general independent of other settings in local.conf so that when
other settings in local.conf conflict with the OUTPUT_URL setting
things "just fail" as in your case.

In general keep the settings in local.conf minimal
i.e. specify only what you really need.

For another example how things "just fail" you may have a look at
https://github.com/rear/rear/issues/1689#issuecomment-356949870
where a local.conf contained also all settings from default.conf
which led to an inexplicable bizarre failure.

jsmeix commented at 2018-03-06 09:00:

@gdha
I think I should document that the settings in local.conf
should be minimal (i.e. only what is actually needed)
to avoid unexpected inexplicable bizarre failures.

github-actions commented at 2020-06-30 01:33:

Stale issue message


[Export of Github issue for rear/rear.]