New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to mount USB device during recover (but not during mkbackup)? #3140
Comments
Offhandedly (i.e. without any testing) In the recovery system /etc/rear-release is unique
so you can test for RECOVERY_MODE preferably via
to find out whether or not you are in the recovery system. What I do not know is how to make ReaR accept |
@jsmeix I ended up with writing a wrapper script around "rear mkbackup" which does several checks (USB stuff actually attached) and does the necessary umount. |
@robertdahlem |
@jsmeix I added my wrappper script so it can be used as an example by others. Unfortunately, GitHub only accepts several extension, so one has to remove the ".txt" suffixes. |
This code probably has not worked since commit 0022063 (PR #2633), because rescue.conf is sourced only when the build area has been already created by invoking mktemp. It is also unneeded, because since that commit, setting TMPDIR in local.conf (which was the initial concern that motivated this code) does not work anyway, as discussed in #2654.
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"):
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
duringmkbackup
but needs to mount/dev/disk/by-label/EXT-PLATTE-1TB
to/media/myuser/EXT-PLATTE-1TB
of whatever suitable path duringrecover
.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 duringmkrescue
?The text was updated successfully, but these errors were encountered: