#3384 Issue open: OUTPUT=PORTABLE does not work for "rear mkbackup" ("mkrescue" plus "mkbackuponly" works)

Labels: bug, documentation

jsmeix opened issue at 2025-01-22 14:44:

During my very first testing of PORTABLE mode because of
https://github.com/rear/rear/pull/3379#issuecomment-2607222152
I noticed that - at least for me -
OUTPUT=PORTABLE does not work for "rear mkbackup"
in contrast to what
https://github.com/rear/rear/blob/master/doc/user-guide/17-Portable-Mode.adoc
tells

To create a portable rescue archive, run rear mkrescue or rear mkbackup
with the OUTPUT=PORTABLE option.

But first "rear mkrescue" and then "rear mkbackuponly"
seems to work (I did not yet test "rear recover" in PORTABLE mode).

I am testing on a SLES15-SP6 virtual KVM/QEMU machine
with the default SLES btrfs structure
in a Git checkout as normal non-root user 'johannes', cf.
https://github.com/rear/rear/pull/3379#issuecomment-2607217184

My etc/rear/local.conf

localhost:/home/johannes/rear.github.master-jsmeix-source-wrapper # grep -v '^#' etc/rear/local.conf 
OUTPUT=PORTABLE
BACKUP=NETFS
BACKUP_OPTIONS="nfsvers=3,nolock"
BACKUP_URL=nfs://192.168.178.66/nfs
REQUIRED_PROGS+=( snapper chattr lsattr )
COPY_AS_IS+=( /usr/lib/snapper/installation-helper /etc/snapper/config-templates/default )
POST_RECOVERY_SCRIPT=( 'if snapper --no-dbus -r $TARGET_FS_ROOT get-config | grep -q "^QGROUP.*[0-9]/[0-9]" ; then snapper --no-dbus -r $TARGET_FS_ROOT set-config QGROUP= ; snapper --no-dbus -r $TARGET_FS_ROOT setup-quota && echo snapper setup-quota done || echo snapper setup-quota failed ; else echo snapper setup-quota not used ; fi' )
SSH_ROOT_PASSWORD="rear"
USE_DHCLIENT="yes"
FIRMWARE_FILES=( 'no' )
MODULES=( 'loaded_modules' )
PROGRESS_MODE="plain"
PROGRESS_WAIT_SECONDS="5"

With

localhost:/home/johannes/rear.github.master-jsmeix-source-wrapper # usr/sbin/rear -s mkbackup

I get this files on my NFS server:

# ls -lhdtr /nfs/localhost/*
-rw-rw-rw- 1 nobody nobody  85M Jan 22 15:12 /nfs/localhost/rear-localhost.iso
-rw-rw-rw- 1 nobody nobody  273 Jan 22 15:12 /nfs/localhost/VERSION
-rw-rw-rw- 1 nobody nobody  202 Jan 22 15:12 /nfs/localhost/README
-rw-rw-rw- 1 nobody nobody 2.1M Jan 22 15:12 /nfs/localhost/rear-localhost.log
-rw-rw-rw- 1 nobody nobody 2.6G Jan 22 15:15 /nfs/localhost/backup.tar.gz
-rw-rw-rw- 1 nobody nobody  10M Jan 22 15:15 /nfs/localhost/backup.log

which are the same as when I set OUTPUT=ISO.

In contrast with

localhost:/home/johannes/rear.github.master-jsmeix-source-wrapper # usr/sbin/rear -D mkrescue

I get this files on my NFS server:

# ls -lhdtr /nfs/localhost/*
-rw------- 1 nobody nobody 804K Jan 22 15:20 /nfs/localhost/localhost-portable.tar.gz
-rw------- 1 nobody nobody  278 Jan 22 15:20 /nfs/localhost/VERSION
-rw------- 1 nobody nobody 2.4M Jan 22 15:20 /nfs/localhost/rear-localhost.log

and then with subsequent

localhost:/home/johannes/rear.github.master-jsmeix-source-wrapper # usr/sbin/rear -D mkbackuponly

I get this files on my NFS server

# ls -lhdtr /nfs/localhost/*
-rw-rw-rw- 1 nobody nobody 804K Jan 22 15:20 /nfs/localhost/localhost-portable.tar.gz
-rw-rw-rw- 1 nobody nobody  278 Jan 22 15:20 /nfs/localhost/VERSION
-rw-rw-rw- 1 nobody nobody 2.4M Jan 22 15:20 /nfs/localhost/rear-localhost.log
-rw-rw-rw- 1 nobody nobody 2.8G Jan 22 15:26 /nfs/localhost/backup.tar.gz
-rw-rw-rw- 1 nobody nobody  11M Jan 22 15:26 /nfs/localhost/backup.log

Regarding the different file permissions:
I did on my NFS server

# chmod a+rw /nfs/localhost/*

to avoid later any NFS file access issues during "rear recover".

Because the portable mode is (at least currently)
only meant a workaround for special cases
I think it is sufficient to only adapt
https://github.com/rear/rear/blob/master/doc/user-guide/17-Portable-Mode.adoc
according to how the current portable mode implementation works
so I think (at least currently) this is only a documentation issue.

schlomo commented at 2025-01-22 15:16:

Thanks for trying out portable mode!

I guess that instead of this

To create a portable rescue archive, run rear mkrescue or rear mkbackup
with the OUTPUT=PORTABLE option.

it should rather read like this

To create a portable rescue archive, install ReaR and then run rear mkrescue or rear mkbackup
with the OUTPUT=PORTABLE option.

As -p disabled internal sanity checks it doesn't prevent running mkbackup from portable mode, but I actually didn't test it the way you did, I only tested mkrescue. I'm actually mostly testing mkrescue from a git checkout mounted into my test VM and not from a proper installation.

Nevertheless, I agree that the behavior is not really self-explanatory and will strive to improve the situation beyond updating the docs


[Export of Github issue for rear/rear.]