#3470 Issue open: Cannot make USB recovery stick

Labels: support / question, old version

nomiSFI opened issue at 2025-05-07 21:44:

ReaR version

2.6

Describe the ReaR bug in detail

/dev/sda is my 8 GB USB stick, formatted as FAT32:

lsblk:
sda                   8:0    1   7,3G  0 disk 
└─sda1                8:1    1   7,3G  0 part 
nvme0n1             259:0    0   1,8T  0 disk 
└─nvme0n1p1         259:1    0   1,8T  0 part 
  ├─mint--vg-root   253:0    0   1,8T  0 lvm  /
  └─mint--vg-swap_1 253:1    0  15,9G  0 lvm  [SWAP]

ReaR local.conf contains:
OUTPUT=USB
USB_DEVICE=/dev/sda1 (also tried with /dev/sda)

rear -D mkrescue throws:

ERROR: 
====================
BUG in /usr/share/rear/output/USB/Linux-i386/850_make_USB_bootable.sh line 40:
'Filesystem for device '/dev/sda1' 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-Boudreaux.log
preferably with full debug information via 'rear -D mkrescue'
====================
Some latest log messages since the last called script 850_make_USB_bootable.sh:
  2025-05-07 23:30:22.293487504 Including output/USB/Linux-i386/850_make_USB_bootable.sh
  2025-05-07 23:30:22.297611675 Entering debugscript mode via 'set -x'.
Aborting due to an error, check /var/log/rear/rear-Boudreaux.log for details
Exiting rear mkrescue (PID 176840) and its descendant processes ...
Running exit tasks
You should also rm -Rf /tmp/rear.xAPc8CW2grQfelI
Beendet
[WARNING] Backup file not found at: 
[ERROR] ReaR backup failed with exit code 143.
(same errors above when I used /dev/sda)

var/log/rear/rear-Boudreaux.log: (same errors when I used /dev/sda)
++ name=/dev/sda1
++ add_dependency /dev/sda1 /dev/sda
++ echo '/dev/sda1 /dev/sda'
++ add_component /dev/sda1 part
++ echo 'todo /dev/sda1 part'
+++ [[ /dev/sda1 = \s\w\a\p\:\/\d\e\v\/\m\a\p\p\e\r\/\m\i\n\t\-\-\v\g\-\s\w\a\p\_\1 ]]
+++ [[ /dev/sda1 = \/\d\e\v\/\m\a\p\p\e\r\/\m\i\n\t\-\-\v\g\-\s\w\a\p\_\1 ]]
+++ [[ /dev/sda1 = \/\d\e\v\/\m\i\n\t\-\v\g ]]
+++ [[ /dev/sda1 = \p\v\:\/\d\e\v\/\n\v\m\e\0\n\1\p\1 ]]
+++ [[ /dev/sda1 = \/\d\e\v\/\n\v\m\e\0\n\1\p\1 ]]
+++ [[ /dev/sda1 = \/\d\e\v\/\n\v\m\e\0\n\1 ]]
+++ [[ /dev/sda1 = \f\s\:\/ ]]
+++ [[ /dev/sda1 = \/\d\e\v\/\m\a\p\p\e\r\/\m\i\n\t\-\-\v\g\-\r\o\o\t ]]
+++ [[ /dev/sda1 = \/\d\e\v\/\m\i\n\t\-\v\g ]]
+++ [[ /dev/sda1 = \p\v\:\/\d\e\v\/\n\v\m\e\0\n\1\p\1 ]]
+++ [[ /dev/sda1 = \/\d\e\v\/\n\v\m\e\0\n\1\p\1 ]]
+++ [[ /dev/sda1 = \/\d\e\v\/\n\v\m\e\0\n\1 ]]
+++ IsInArray /dev/sda1
+++ current=/dev/sda1
+++ echo /dev/sda1
++ Debug 'Marking /dev/sda1 as done (dependent on /dev/sda)'
++ Log 'Marking /dev/sda1 as done (dependent on /dev/sda)'
++ echo '2025-05-07 23:28:29.847772255 Marking /dev/sda1 as done (dependent on /dev/sda)'
2025-05-07 23:28:29.847772255 Marking /dev/sda1 as done (dependent on /dev/sda)
++ mark_as_done /dev/sda1
++ Debug 'Marking /dev/sda1 as done.'
++ Log 'Marking /dev/sda1 as done.'
++ echo '2025-05-07 23:28:29.849342583 Marking /dev/sda1 as done.'
2025-05-07 23:28:29.849342583 Marking /dev/sda1 as done.
++ sed -i 's;todo\ /dev/sda1\ ;done\ /dev/sda1\ ;' /var/lib/rear/layout/disktodo.conf
+++ grep '^/dev/sda1 ' /var/lib/rear/layout/diskdeps.conf
+++ [[ /dev/sda1 = \f\s\:\/ ]]
+++ [[ /dev/sda1 = \/\d\e\v\/\m\a\p\p\e\r\/\m\i\n\t\-\-\v\g\-\r\o\o\t ]]
+++ [[ /dev/sda1 = \/\d\e\v\/\m\i\n\t\-\v\g ]]
+++ [[ /dev/sda1 = \p\v\:\/\d\e\v\/\n\v\m\e\0\n\1\p\1 ]]
+++ [[ /dev/sda1 = \/\d\e\v\/\n\v\m\e\0\n\1\p\1 ]]
+++ [[ /dev/sda1 = \/\d\e\v\/\n\v\m\e\0\n\1 ]]
++++ USB_DEVICE=/dev/sda1
++ '[' /dev/sda -a /dev/sda1 ']'
+++ grep -E '^/dev/sda1 |^/dev/sda1 ' /proc/mounts
++ BugError 'Filesystem for device '\''/dev/sda1'\'' could not be found'
'\''Filesystem for device '\''/dev/sda1'\'' could not be found'\''
'\''Filesystem for device '\''/dev/sda1'\'' could not be found'\''
'\''Filesystem for device '\''/dev/sda1'\'' could not be found'\''
'\''Filesystem for device '\''/dev/sda1'\'' could not be found'\''
'Filesystem for device '/dev/sda1' could not be found'
'\''Filesystem for device '\''/dev/sda1'\'' could not be found'\''
'\''Filesystem for device '\''/dev/sda1'\'' could not be found'\''

Best regards
Frank

Platform

Linux x64

OS version

NAME="Linux Mint"
VERSION="21.3 (Virginia)" ID=linuxmint ID_LIKE="ubuntu debian"
PRETTY_NAME="Linux Mint 21.3" VERSION_ID="21.3"
HOME_URL="https://www.linuxmint.com/" BUG_REPORT_URL="http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/"
VERSION_CODENAME=virginia UBUNTU_CODENAME=jammy

Backup

No response

Storage layout

No response

What steps will reproduce the bug?

rear -D mkrescue

Workaround, if any

No valid workaround found.

Additional information

Tried to create an USB recovery stick since neither OUTPUT=ISO nor OUTPUT=PXE worked with iVentoy IPXE server.

gdha commented at 2025-05-09 08:29:

You need to format the USB stick first according the instructions listed in https://relax-and-recover.org/usage/#recovery_from_usb

nomiSFI commented at 2025-05-15 21:26:

Dear gdha,
thanks for pointing this out. However, I am still getting an error, see attached screenshot.
Image
Best regards Frank

gdha commented at 2025-05-16 06:14:

@nomiSFI Can you show us your /etc/rear/local.conf file please?

nomiSFI commented at 2025-05-16 16:10:

Dear gdha,
I noticed that I did not comment following lines in my local.conf:

ISO_MKISOFS_BIN="/usr/bin/mkisofs"
ISO_NAME="rear-rescue"
ISO_ISOLINUX=auto
ISO_DIR="/mnt/NAS/ReaR/iso"

The errors in my earlier message may therefore not be relevant.

I did a new start, omitting the ISO stuff:

/etc/rear/local.conf
OUTPUT=USB
USB_DEVICE=/dev/sda
BACKUP=NETFS
BACKUP_URL=nfs://192.168.100.5/mnt/DataStore/Backups/
USE_STATIC_NETWORKING=1
STATIC_IP=192.168.100.1
STATIC_NETMASK=255.255.255.0
STATIC_GATEWAY=192.168.100.250
STATIC_BROADCAST=192.168.100.255
STATIC_HOSTNAME=Boudreaux
STATIC_DNS="192.168.100.100"
BOOTLOADER="GRUB"
GRUB_RESCUE=y
BACKUP_PROG_COMPRESS_OPTIONS="--zstd"
BACKUP_PROG_EXCLUDE=(
"/home"
".iso"
"/tmp/
"
"/var/tmp/"
"/var/cache/
"
"/var/log/"
"/run/
"
"/mnt/"
"/media/
"
"/dev/"
"/proc/
"
"/sys/*"
)

$ sudo rear -v mkrescue
Relax-and-Recover 2.6 / Git
Running rear mkrescue (PID 30937)
Using log file: /var/log/rear/rear-Boudreaux.log
Running workflow mkrescue on the normal/original system
Using autodetected kernel '/boot/vmlinuz-5.15.0-140-generic' as kernel in the recovery system
Creating disk layout
Overwriting existing disk layout file /var/lib/rear/layout/disklayout.conf
Docker is running, skipping filesystems mounted below Docker Root Dir /var/lib/docker
Using specified bootloader 'GRUB'
Verifying that the entries in /var/lib/rear/layout/disklayout.conf are correct ...
Creating recovery system root filesystem skeleton layout
Skipping 'docker0': not bound to any physical interface.
Copying logfile /var/log/rear/rear-Boudreaux.log into initramfs as '/tmp/rear-Boudreaux-partial-2025-05-16T17:38:10+02:00.log'
Copying files and directories
Copying binaries and libraries
Copying all kernel modules in /lib/modules/5.15.0-140-generic (MODULES contains 'all_modules')
Copying all files in /lib*/firmware/
Symlink '/usr/share/misc/magic' -> '/usr/share/file/magic' refers to a non-existing directory on the recovery system.
It will not be copied by default. You can include '/usr/share/file/magic' via the 'COPY_AS_IS' configuration variable.
Symlink '/lib/modules/5.15.0-140-generic/build' -> '/usr/src/linux-headers-5.15.0-140-generic' refers to a non-existing directory on the recovery system.
It will not be copied by default. You can include '/usr/src/linux-headers-5.15.0-140-generic' via the 'COPY_AS_IS' configuration variable.
Testing that the recovery system in /tmp/rear.Koqr6vDmnDTjvDk/rootfs contains a usable system
Creating recovery/rescue system initramfs/initrd initrd.cgz with gzip default compression
Created initrd.cgz with gzip default compression (782779775 bytes) in 65 seconds
ERROR: Mount command 'mount -v -o rw,noatime /dev/sda /tmp/rear.Koqr6vDmnDTjvDk/outputfs' failed.
Some latest log messages since the last called script 100_mount_output_path.sh:
2025-05-16 17:39:53.889032507 Including output/default/100_mount_output_path.sh
mkdir: created directory '/tmp/rear.Koqr6vDmnDTjvDk/outputfs'
2025-05-16 17:39:53.901661070 Mounting with 'mount -v -o rw,noatime /dev/sda /tmp/rear.Koqr6vDmnDTjvDk/outputfs'
mount: /tmp/rear.Koqr6vDmnDTjvDk/outputfs: no medium found on /dev/sda.
Aborting due to an error, check /var/log/rear/rear-Boudreaux.log for details
Exiting rear mkrescue (PID 30937) and its descendant processes ...
Running exit tasks
Beendet

/var/log/rear/rear-Boudreaux.log:
2025-05-16 17:39:53.845509198 ======================
2025-05-16 17:39:53.849814588 Running 'output' stage
2025-05-16 17:39:53.854131363 ======================
2025-05-16 17:39:53.869175610 Including output/default/010_set_umask.sh
2025-05-16 17:39:53.872644576 Setting umask to 077
2025-05-16 17:39:53.880779875 Including output/USB/Linux-i386/100_create_efiboot.sh
2025-05-16 17:39:53.889032507 Including output/default/100_mount_output_path.sh
mkdir: created directory '/tmp/rear.Koqr6vDmnDTjvDk/outputfs'
2025-05-16 17:39:53.901661070 Mounting with 'mount -v -o rw,noatime /dev/sda /tmp/rear.Koqr6vDmnDTjvDk/outputfs'
mount: /tmp/rear.Koqr6vDmnDTjvDk/outputfs: no medium found on /dev/sda.
2025-05-16 17:39:53.917262235 ERROR: Mount command 'mount -v -o rw,noatime /dev/sda /tmp/rear.Koqr6vDmnDTjvDk/outputfs' failed.
===== Stack trace =====
Trace 0: /usr/sbin/rear:541 main
Trace 1: /usr/share/rear/lib/mkrescue-workflow.sh:22 WORKFLOW_mkrescue
Trace 2: /usr/share/rear/lib/framework-functions.sh:116 SourceStage
Trace 3: /usr/share/rear/lib/framework-functions.sh:56 Source
Trace 4: /usr/share/rear/output/default/100_mount_output_path.sh:15 source
Trace 5: /usr/share/rear/lib/global-functions.sh:563 mount_url
=== End stack trace ===
2025-05-16 17:39:53.928602987 Exiting rear mkrescue (PID 30937) and its descendant processes ...
2025-05-16 17:39:57.066226335 rear,30937 /usr/sbin/rear -v mkrescue
-rear,50089 /usr/sbin/rear -v mkrescue-pstree,50090 -Aplau 30937
/usr/share/rear/lib/_input-output-functions.sh: line 151: kill: (50093) - No such process
2025-05-16 17:39:57.109129939 Running exit tasks
removed directory '/tmp/rear.Koqr6vDmnDTjvDk/outputfs'
2025-05-16 17:39:57.114018159 Finished in 113 seconds
2025-05-16 17:39:57.116803934 Removing build area /tmp/rear.Koqr6vDmnDTjvDk
removed directory '/tmp/rear.Koqr6vDmnDTjvDk'
2025-05-16 17:39:58.133089280 End of program reached

I must be possible to backup to a NFS share on my NAS and create a bootable USB stick which then can do a restore from the NAS. The information in https://relax-and-recover.org/usage/#recovery_from_usb suggests this line: BACKUP_URL="usb:///dev/disk/by-label/REAR-000".
However, I can hardly backup 2 TB to a 8GB USB stick, the idea is to save to the NAS.

Thanks for your help!
Best regards
Frank

gdha commented at 2025-05-17 08:43:

@nomiSFI in your local.conf file remove all STATIC_* lines are these will not be used by ReaR!
Use the following example instead:

NETWORKING_PREPARATION_COMMANDS=( 'ip addr add 192.168.100.2/24 dev eth0' 'ip link set dev eth0 up' 'ip route add default via 192.168.100.1' 'return' )

Furthermore, the line USB_DEVICE=/dev/sda is not correct as it should be USB_DEVICE=/dev/disk/by-label/REAR-000 if you formatted the USB device via rear format /dev/sda

jsmeix commented at 2025-05-19 13:07:

@nomiSFI
regarding "backup 2 TB":

Don't do that with ReaR.

Regarding ReaR versus "big data" backup see my
https://github.com/rear/rear/issues/3451#issuecomment-2841051182
which is in general about

separating disaster recovery of the basic operating system
from restore of the big data

So I recommend to use OUTPUT=USB with a (removable) disk
for ReaR and its backup of only the basic operating system
and save your "big data" to your NAS in a separated
procedure which is independent of ReaR.

Of course you are free to do a "backup 2 TB" with
ReaR and OUTPUT=USB on a sufficiently big (removable)
external disk that is connected e.g. via fast USB3
which could be even faster than NAS network access
(depending on your USB and network hardware).

In general you may also have a look at the section
"Relax-and-Recover versus backup and restore"
https://en.opensuse.org/SDB:Disaster_Recovery#Relax-and-Recover_versus_backup_and_restore

nomiSFI commented at 2025-05-21 11:20:

Dear Johannes,
thanks for your reply!
I still cannot restore from my rear formatted 250GB SSD 850 EVO USB drive :-(
Here's my local.conf:

OUTPUT=USB
OUTPUT_URL=usb:///dev/disk/by-label/REAR-000
USB_DEVICE=/dev/disk/by-label/REAR-000
BACKUP=NETFS
BACKUP_URL=nfs://192.168.100.5/mnt/DataStore/Backups
COPY_AS_IS=( /lib/modules/$(uname -r)/kernel/drivers/video/nvidia.ko )
Boudreaux.old': Device or resource busy
BACKUP_PROG_COMPRESS_OPTIONS=( -I "zstd -3 -c" )
BACKUP_PROG_COMPRESS_SUFFIX=".zst"
BACKUP_PROG_EXCLUDE=( '/tmp/*' '/dev/shm/*' '/home/*' '/media/*' '/mnt/*' '/usr/ollama/*' '/usr/local/lib/ollama/*' '/opt/iventoy/*'  '*.iso' "$VAR_DIR/output/*" )

And here the error after a successful boot:
Image

What needs to be done to get the neccessary files into the /usr/share/rear/direcotory?
Image

Thanks much, appreciate your help!
Best regards
Frank

jsmeix commented at 2025-05-21 15:42:

@nomiSFI
your COPY_AS_IS=( ... ) kills it all.
See usr/share/rear/conf/default.conf
for ReaR 2.6 online starting at
https://github.com/rear/rear/blob/rear-2.6/usr/share/rear/conf/default.conf#L1340
how to correctly add things to arrays like COPY_AS_IS
which are predefined in default.conf as

COPY_AS_IS=( $SHARE_DIR $VAR_DIR )

Your COPY_AS_IS=( ... ) overwrites that with only your values
so you get in your ReaR recovery system only what you specified
via your COPY_AS_IS=( ... ) without all the ReaR stuff
in ReaR's $SHARE_DIR and $VAR_DIR.
I.e. in your local.conf use

COPY_AS_IS+=( your additional things )

Same for BACKUP_PROG_EXCLUDE.
When you like to specify additional things to exclude use

BACKUP_PROG_EXCLUDE+=( your additional things )

When you want to overwrite ReaR automtisms for BACKUP_PROG_EXCLUDE
and only want to exclude what you explicity specified then use

BACKUP_PROG_EXCLUDE=( only your things )

By the way:
I wonder what that line

Boudreaux.old': Device or resource busy

is in your local.conf in your
https://github.com/rear/rear/issues/3470#issuecomment-2897579989
Is that line perhaps a copy&paste typo
or does that line really exist in your local.conf?

nomiSFI commented at 2025-05-22 21:31:

Dear Johannes,

thank you for your reply, this helped alot!

Now I am able to boot the recovery media without a problem.
However, when trying to recover my system I could nor do so, due to a missing boot loader:

Image

I have: grub-install (GRUB) 2.06-2ubuntu7.2, Legacy BIOS boot and boot disk layout:

nvme0n1
│                                                                             
└─nvme0n1p1
     LVM2_m LVM2        aQsufx-QP1n-fPdy-lmNE-TlmD-TbCS-Frw8GS                
  ├─mint--vg-root
  │  ext4   1.0         43203ead-891a-4fc7-9d19-5138c6ce5537    893,5G    47% /
  └─mint--vg-swap_1
     swap   1           7eecfb22-1cfe-4a7b-8e5f-d0b31912a8e2                  [SWAP]

I am trying to convert the information in /usr/share/rear/finalize/Linux-i386/660_install_grub2.sh to my local.conf (below) but seem not to be able to do so.

OUTPUT=USB
OUTPUT_URL=usb:///dev/disk/by-label/REAR-000
USB_DEVICE=/dev/disk/by-label/REAR-000
BACKUP=NETFS
BACKUP_URL=nfs://192.168.100.5/mnt/DataStore/Backups
USE_STATIC_NETWORKING=yes
KERNEL_CMDLINE="modprobe.blacklist=nvidia,nvidia_uvm,nvidia_modeset,nvidia_drm nomodeset vga=normal"
BACKUP_PROG_COMPRESS_OPTIONS=( -I "zstd -3 -c" )
BACKUP_PROG_COMPRESS_SUFFIX=".zst"
BACKUP_PROG_EXCLUDE=( '/tmp/*' '/dev/shm/*' '/home/*' '/media/*' '/mnt/*' '/usr/ollama/*' '/opt/iventoy/*' '*.iso' "$VAR_DIR/output/*" )

Once agian, thanks much. Your help is really appreciated!

Bes regards
Frank

P.S. Boudreaux.old': Device or resource busy: This was an old comment and is obsolete.

jsmeix commented at 2025-05-23 06:54:

@nomiSFI
when

chroot /mnt/local bash --login

fails after "rear recover", things don't look good
because at /mnt/local the recreated system is mounted
where in particular your backup should have been restored
so there should be a binary 'bash' below /mnt/local
normally this would be /mnt/local/bin/bash

PATH does matter:
For ReaR 2.6 inside the ReaR recovery system

PATH=/bin

https://github.com/rear/rear/blob/rear-2.6/usr/share/rear/skel/default/etc/profile#L6
so inside the recreated system the binary 'bash'
must be /bin/bash so that it can be found by

chroot /mnt/local bash --login

i.e. from inside a ReaR 2.6 recovery system
the 'bash' must be /mnt/local/bin/bash

So you should first and foremost verify that

  • your backup is sufficiently complete (contains all needed files)
  • your backup was properly restored during "rear recover"
  • you have a /mnt/local/bin/bash after "rear recover"

Regarding the bootloader installation:
What did "rear recover" show you about the bootloader installation
in the recreated system?
During "rear recover" the bootloader installation happens
after the backup was restored.

jsmeix commented at 2025-05-23 07:09:

@nomiSFI

is there a special reason why you use a rather old ReaR version?
ReaR 2.6 is from June 2020 i.e. almost 5 years old.
Our current release is version 2.9 (from January 2025).

FYI some generic boilerplate info:

In general I recommend to try out our latest GitHub master code
because the GitHub master code is the only place where we (i.e.
the ReaR upstream authors and maintainers) can fix things and
if there are issues it helps when you use exactly the code
where we could fix things.

See the "QUICK START GUIDE" and "INSTALLATION" parts on
https://github.com/rear/rear

Additionally / alternatively see the section
"Testing current ReaR upstream GitHub master code" in
https://en.opensuse.org/SDB:Disaster_Recovery
how you can try out our current ReaR GitHub master code
without conflicts with your already installed ReaR version.

In general we at ReaR upstream do not support older ReaR versions.
We at ReaR upstream do not plain reject issues with older ReaR versions
(e.g. we may answer easy to solve questions also for older ReaR versions)
but we do not spend much time on issues with older ReaR versions because
we do not (and cannot) fix issues in released ReaR versions.
Issues in released ReaR versions are not fixed by us (by ReaR upstream).
Issues in released ReaR versions that got fixed in current ReaR upstream
GitHub master code might be fixed (if the fix can be backported with
reasonable effort) by the Linux distributor wherefrom you got ReaR.

In particular regarding Ubuntu / Debian
and Linux distributions which are based on them:

I am neither a Ubuntu user nor a Debian user nor a Linux Mint user.
Currently we at ReaR upstream do not have an active
maintainer for Ubuntu / Debian / Linux Mint.
So ReaR support for Ubuntu / Debian / Linux Mint
can be only as good as voluntary contributors
who use those Linux distributions contribute
which is much appreciated!

In particular regarding Ubuntu:
It seems Canonical is not sufficiently interested in ReaR
in contrast to Red Hat and SUSE who pay developers
(like me from SUSE and e.g. @pcahyna and @lzaoral from Red Hat)
to contribute to upstream ReaR because Red Hat and SUSE
support ReaR in their enterprise Linux distributions.


[Export of Github issue for rear/rear.]