#3140 Issue open: How to mount USB device during recover (but not during mkbackup)?

robertdahlem opened issue at 2024-01-26 18:29:

  • ReaR version ("/usr/sbin/rear -V"): Relax-and-Recover 2.6 / Git

  • If your ReaR version is not the current version, explain why you can't upgrade: First trying to run Ubuntu out of the box. Will happily try 2.7 or master when asked to.

  • OS version ("cat /etc/os-release" or "lsb_release -a" or "cat /etc/rear/os.conf"): Ubuntu 22.04

  • ReaR configuration files ("cat /etc/rear/site.conf" and/or "cat /etc/rear/local.conf"):

OUTPUT=USB
USB_DEVICE=/dev/disk/by-label/REAR-000
BACKUP=NETFS
BACKUP_URL=file:///media/myuser/EXT-PLATTE-1TB/rear
AUTOEXCLUDE_AUTOFS=y
  • Hardware vendor/product (PC or PowerNV BareMetal or ARM) or VM (KVM guest or PowerVM LPAR): KVM guest

  • System architecture (x86 compatible or PPC64/PPC64LE or what exact ARM device): x86_64

  • Storage (local disk or SSD) and/or SAN (FC or iSCSI or FCoE) and/or multipath (DM or NVMe): automounted USB device

  • Description of the issue (ideally so that others can reproduce it):

Ubuntu out of the box automounts any USB storage that gets attached under /media/myuser/$LABEL_OF_DEVICE_OR_PARTITION.

I can prevent that with LABEL=REAR-000 none none noauto 0 0 in /etc/fstab for the USB stick to create the ISO. But I do not wish to prevent this for the backup device because it holds other stuff too that shall stay visible to the (non-enlightened) user.

ReaR shall just use /media/myuser/EXT-PLATTE-1TB/rear during mkbackup but needs to mount /dev/disk/by-label/EXT-PLATTE-1TB to /media/myuser/EXT-PLATTE-1TB of whatever suitable path during recover.

Using BACKUP_MOUNTCMD fails at start of mkbackup with "already mounted".
Using BACKUP_URL=usb:///dev/disk/by-label/EXT-PLATTE-1TB also fails with "already mounted".

So my question is: how do I get ReaR to accept a mounted path as BACKUP_URL during mkbackup but to mount it by itself during mkrescue?


[Export of Github issue for rear/rear.]