#2348 Issue closed: OUTPUT=USB not supported on any architecture except PC 'Linux-i386' (in particular not on POWER)

Labels: enhancement, documentation, fixed / solved / done

jsmeix opened issue at 2020-03-27 13:46:

Currently with OUTPUT=USB on POWER architecture
the USB medium cannot be booted.

In particular as a precondition the "rear format" workflow may need
enhancements to prepare a USB medium so that it can be booted
on POWER architecture e.g. a PreP partition could be needed, cf.
https://github.com/rear/rear/issues/2344#issuecomment-600838126

With current ReaR GitHub Master code
we have those scripts for OUTPUT=USB on PC platform:

# find usr/share/rear/ -type f | grep 'i386' | grep '/USB/'

usr/share/rear/output/USB/Linux-i386/850_make_USB_bootable.sh
usr/share/rear/output/USB/Linux-i386/830_copy_kernel_initrd.sh
usr/share/rear/output/USB/Linux-i386/300_create_extlinux.sh
usr/share/rear/output/USB/Linux-i386/100_create_efiboot.sh
usr/share/rear/prep/USB/Linux-i386/350_check_usb_disk.sh
usr/share/rear/prep/USB/Linux-i386/350_find_syslinux_modules.sh
usr/share/rear/prep/USB/Linux-i386/340_find_mbr_bin.sh
usr/share/rear/prep/USB/Linux-i386/400_check_extlinux.sh

But we have nothing for POWER architecture:

# find usr/share/rear/ -type f | grep -i 'ppc' | grep '/USB/'

[no output]

We also have nothing for IBM Z (s390) or ARM architecture:

# find usr/share/rear/ -type f | grep -i 's390' | grep '/USB/'

[no output]

# find usr/share/rear/ -type f | grep -i 'arm' | grep '/USB/'

[no output]

Related issues are
https://github.com/rear/rear/issues/2243
and
https://github.com/rear/rear/issues/2344

For some more analysis and details see in particular
https://github.com/rear/rear/issues/2243#issuecomment-537093945
https://github.com/rear/rear/issues/2243#issuecomment-537436000
https://github.com/rear/rear/issues/2243#issuecomment-538270003

A workaround to get a bootable USB on POWER architecture
that only works for Power BareMetal with the petitboot bootloader
is to make an ISO by using OUTPUT=ISO and
copy the ISO on a USB device with dd, see
https://github.com/rear/rear/issues/2243#issuecomment-537354570

For comparison what we have for OUTPUT=ISO
for PC platform

# find usr/share/rear/ -type f | grep 'i386' | grep '/ISO/'

usr/share/rear/output/ISO/Linux-i386/800_create_isofs.sh
usr/share/rear/output/ISO/Linux-i386/810_prepare_multiple_iso.sh
usr/share/rear/output/ISO/Linux-i386/260_EFISTUB_populate.sh
usr/share/rear/output/ISO/Linux-i386/820_create_iso_image.sh
usr/share/rear/output/ISO/Linux-i386/830_create_iso_image_EFISTUB.sh
usr/share/rear/output/ISO/Linux-i386/850_check_for_errors.sh
usr/share/rear/output/ISO/Linux-i386/300_create_isolinux.sh
usr/share/rear/output/ISO/Linux-i386/250_populate_efibootimg.sh
usr/share/rear/output/ISO/Linux-i386/700_create_efibootimg.sh
usr/share/rear/prep/ISO/Linux-i386/330_find_isolinux.sh

and for POWER architecture

# find usr/share/rear/ -type f | grep 'ppc' | grep '/ISO/'

usr/share/rear/output/ISO/Linux-ppc64/300_create_yaboot.sh
usr/share/rear/output/ISO/Linux-ppc64/310_create_grub2.sh
usr/share/rear/output/ISO/Linux-ppc64le/800_create_isofs.sh
usr/share/rear/output/ISO/Linux-ppc64le/820_create_iso_image.sh
usr/share/rear/output/ISO/Linux-ppc64le/300_create_grub2.sh

I think as a first step at least the workaround should be documented
to make an ISO and dump it on a USB device, cf.
https://github.com/rear/rear/issues/2243#issuecomment-537354570

I think "rear mkrescue/mkbackup" should even error out
with OUTPUT=USB on POWER architecture
because that does not provide what the user expects.
In general it is better to error out early in "rear mkrescue/mkbackup"
when it is known that things will not work this way
than to let the user find out later by trial and error
while testing "rear recover" that things do not work,

jsmeix commented at 2020-03-30 12:10:

As far as I see a bootable OUTPUT=USB is not supported
on any architecture except PC compatible x86/x86_64 i.e. Linux-i386.

Reasoning:

According to

# find usr/share/rear/ -type f | grep -o '/[^/]*/[0-9][0-9][0-9]_' | cut -d '/' -f2 | sort -u

Debian
Fedora
Linux
Linux-arm
Linux-i386
Linux-ia64
Linux-ppc64
Linux-ppc64le
Linux-s390
SUSE_LINUX
default
i386
s390

we have architecture specific scripts for those architectures
so I use that to see what architecture specific USB scripts we have

# for arch in $( find usr/share/rear/ -type f | grep -o '/[^/]*/[0-9][0-9][0-9]_' | cut -d '/' -f2 | sort -u | grep -v 'default' ) ; do find usr/share/rear/ -type f | grep USB | grep "/$arch/" ; done

usr/share/rear/output/USB/Linux-i386/850_make_USB_bootable.sh
usr/share/rear/output/USB/Linux-i386/830_copy_kernel_initrd.sh
usr/share/rear/output/USB/Linux-i386/300_create_extlinux.sh
usr/share/rear/output/USB/Linux-i386/100_create_efiboot.sh
usr/share/rear/prep/USB/Linux-i386/350_check_usb_disk.sh
usr/share/rear/prep/USB/Linux-i386/350_find_syslinux_modules.sh
usr/share/rear/prep/USB/Linux-i386/340_find_mbr_bin.sh
usr/share/rear/prep/USB/Linux-i386/400_check_extlinux.sh

which are exactly the "scripts for OUTPUT=USB on PC platform"
in my initial comment here.

So I conclude Linux-i386 is the only architecture
where OUTPUT=USB is really supported.

jsmeix commented at 2020-04-07 07:41:

On POWER architecture a PreP partition is not always needed, see
https://github.com/rear/rear/issues/2243#issuecomment-605506628
and the related comments around it that read
(excerpts plus [...] addons):

... according to #2344 [OUTPUT=USB on PPC64le PowerVM not bootable]
a PreP partition is missing, so the system should not even start booting,
while here [#2243 IBM Power8 BareMetal rescue USB boot kernel panic: ...]
it starts booting and can not mount root
...
the reason why the system can boot is because it is using
petitboot ... on Power BareMetal system (like LC models).
In a nuteshell petitboot is micro-linux in firmware which load
and scan disk and network to find grub configuration and
aggregate then into a single menu (for disk, SAN, network, dvd, usb).
So, in that case, PreP partition is not needed.
...
#2344 is PowerVM LPAR, in that case, Prep is needed.

gdha commented at 2020-04-12 14:05:

@jsmeix You are right we should bail out the code with an error non all non-Linux-i386 architectures for the moment (with OUTPUT=USB) - perhaps with an ask for sponsoring?

I think "rear mkrescue/mkbackup" should even error out
with OUTPUT=USB on POWER architecture
because that does not provide what the user expects.

jsmeix commented at 2020-05-12 12:39:

I would like to have https://github.com/rear/rear/pull/2396
merged before the ReaR 2.6 release.

For now https://github.com/rear/rear/pull/2396
only errors out on POWER architectures
(Linux-ppc64 and Linux-ppc64le)
because I do not yet know how OUTPUT=USB
actually behaves on other non-x86 architectures.

gdha commented at 2020-05-12 12:47:

@jsmeix go ahead - as long we are not in a change freeze you can commit whatever you think is reasonable

jsmeix commented at 2020-05-13 12:23:

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

pcahyna commented at 2021-05-17 14:35:

FYI I don't know about POWER, but I intend to implement OUTPUT=USB on S/390, when more the current important issues get resolved.


[Export of Github issue for rear/rear.]