#1467 Issue closed: Problems with bootloader and excluding devices

Labels: support / question, fixed / solved / done

malvinas2 opened issue at 2017-09-02 16:52:

  • rear version: Relax-and-Recover 2.2 / Git
  • OS version: Debian GNU/Linux 8.9 (jessie) with Openmediavault 3.0.87)
  • rear configuration files: please see below
  • Are you using legacy BIOS or UEFI boot? UEFI

Hello,
please let me explain two things before describing my problems:

  • I know that ReaR is mostly used within professional environments, but my NAS, serving as media server at home, seems to be a little special, at least every other program I tried (like the 64-bit version of Clonezilla) just throws out error messages during startup. The problem seems to be the combination between 64-bit, boot by UEFI (GRUB2-bootloader) and a M.2-SSD attached via PCIexpress and NVMe.
  • I am also aware that the issue-section of github is normally not used to discuss user problems, but I could not found any other forum and the mailing list doesn't seem to be very populated.

Starting situation and objective

I have got a self-built NAS Server which boots from a SSD (/dev/nvme0n1) and uses two hard-disks (/dev/sda, /dev/sdb) which form a software raid 1 device (/srv/dev-disk-by-label-OMVDisc).
I want to clone SSD to recover a broken system.

First attempt (creating USB-stick, bootloader not working)

I installed Rear and started with the usage scenario of building a bootable USB stick.
rear format /dev/sdc. The USB stick is successfully formated and labeled as REAR-000.
The content of the configuration file is:
OUTPUT=USB
BACKUP=NETFS
BACKUP_URL="usb:///dev/disk/by-label/REAR-000"
rear format /dev/sdc doesn't work and gives the following error message:
ERROR: /dev/disk/by-label/REAR-EFI is not block device. Use `rear format -- --efi <USB_device_file>' for correct format

Obviously, REAR tries to use the correct bootloader (USING_UEFI_BOOTLOADER=1) and is searching for a label 'REAR-EFI', which does not exist.
After modifiying the configuration file
BACKUP_URL="usb:///dev/disk/by-label/REAR-**EFI**"
and changing the label e2label /dev/sdc1 "REAR-**EFI**" the command rear format /dev/sdc works.
But when I try do boot from the created USB stick I get the error message:
No DEFAULT or UI configuration directive found!
Trying the same procedure another time resulted in the error message:
Failed to load COM32 file chain.c32
Failed to load COM32 file menu.c32

==> Is there any possibility to label the USB Stick "REAR-EFI" right from the beginning ?
==> What about the error messages when booting from the stick? What do I have to do to correct this?

Second attempt (creating ISO-file, excluding devices and directories)

I changed the configuration as follows:
OUTPUT=ISO
BACKUP=NETFS
OUTPUT_URL=file:///media/usb1
#OUTPUT_URL=file:///srv/dev-disk-by-label-OMVDisc/downloads (this would not work)
BACKUP_URL=iso://
An ISO-file containing the rescue system as well as the backup is successfully created and copied to the USB-Stick. Unetbootin refuses to work on my system because of a missing X-Server, so I copy the iso-file to a Windows-PC and restore the iso-file using Unetbootin for Windows (sic!) on an USB-Stick.

The so created USB-Stick boots successfully on the NAS using UEFI.

==> The boot menu just contains the entries "Rear without secure boot, Rear with secure boot, Exit, Reboot", is this correct or is there something missing?
==> I just want the content of the SSD to be included in the backup archive. The content of the two hard disks (forming the RAID1 device) should not be included neither the content of any connected USB-device.
What do I have to use to achieve this?
EXCLUDE_RECREATE=( "${EXCLUDE_RECREATE[@]}" "fs:/media/usb1" )
EXCLUDE_RECREATE=( "${EXCLUDE_RECREATE[@]}" "/dev/sdc" )
Or should I use EXCLUDE_BACKUP=() or EXCLUDE_MOUNTPOINTS=() or EXCLUDE_COMPONENTS or .... ?

How do I have to address in this context the two hard disks ?
Separated, something like
EXCLUDE_RECREATE=( "${EXCLUDE_RECREATE[@]}" "/dev/sda" "/dev/sdb" )
or the RAID1 as a whole:
EXCLUDE_RECREATE=( "${EXCLUDE_RECREATE[@]}" "/srv/dev-disk-by-label-OMVDisc" ) ?

==> Directories of the SSD to be cloned can be exluded using the following command, is this right ?
BACKUP_PROG_EXCLUDE=( "${BACKUP_PROG_EXCLUDE[@]}" '/reariso/*' )

USBmount

I didn't further investigate it, but is it possible that REAR interferes with USBmount ? The USB stick has to be unmounted to execute the usr/sbin/rear -v mkrescue command, but even after umount /media/usb0 usbmount tries to mount it again, which confuses then REAR ?!?!

gozora commented at 2017-09-04 15:36:

Hello @malvinas2,

I installed Rear and started with the usage scenario of building a bootable USB stick.
rear format /dev/sdc. The USB stick is successfully formated and labeled as REAR-000.
The content of the configuration file is:

If you are using UEFI, you must use right command to format your USB target device.
As ReaR correctly suggests:
rear format -- --efi <USB_device_file>

After ReaR is finished with formatting you should have (at least) two partitions present:

  1. formatted with vfat (this one is used by UEFI to bring ReaR recovery system up)
  2. formatted with "Linux" filesystem (ext3 most probably) which will hold your data for restore.

Please be careful during formatting and choose right disk to format as well as during rear recover to choose right disk for your target restore.

V.

gozora commented at 2017-09-04 15:56:

@malvinas2
Ahh, just realize there is another question about excludes ... That's why issues should be posted separately I guess :-).

Try to read default.conf you might find some useful hidden information there. ;-).

V.

malvinas2 commented at 2017-09-04 21:43:

@gozora
Thank you for your support.

  1. Well, I don't know why there are two times two hyphens rear format -- --efi <device> instead of just rear format -- efi <device>, but it works.
  2. Wow, the information in default.conf is amazing! So in my case I would use EXCLUDE_MD=(/dev/md127) for the raid consisting of two hard disks (/dev/sda and /dev/sdb, mounted at /srv/dev-disk-by-label-OMV) and I could use EXCLUDE_MOUNTPOINTS=(/media/usb0) to exclude USB-sticks, which in fact isn't necessary, because of the default setting AUTOEXCLUDE_PATH=( /media ).

gozora commented at 2017-09-05 06:51:

@malvinas2

Thank you for your support.

Anytime ...

jsmeix commented at 2017-09-05 08:56:

@malvinas2
FYI regarding the syntax in things like

rear -v format -- --efi --force /dev/sdX

see
https://github.com/rear/rear/issues/1439#issuecomment-320266477


[Export of Github issue for rear/rear.]