#1081 Issue closed
: "rear recover" fails for multiple ISOs (ISO_MAX_SIZE=...) at least on SLE12¶
Labels: enhancement
, bug
, cleanup
, fixed / solved / done
jsmeix opened issue at 2016-11-23 13:30:¶
With something like ISO_MAX_SIZE=1000
during "rear recover" fails because in
restore/NETFS/default/40_restore_backup.sh
label=$(blkid /dev/${dev} | awk 'BEGIN{FS="[=\"]"} {print $3}') if [[ $label = $vol_name ]]; then
does not work - at least it does not work on SLE12.
The following simpler code does work (at least for me):
if blkid /dev/${dev} | grep -q "$vol_name" ; then
I guess the output format of 'blkid' has recently changed
(on SLE12 /usr/sbin/blkid belongs to the util-linux-2.28-40 RPM)
or the output format of 'blkid' is different on SLE12
compared to other Linux distributions.
I assume my simpler code will work generically
on all Linux distributions.
jsmeix commented at 2016-11-23 13:54:¶
With a sufficiently meaningful/unique ISO_VOLID
(default.conf has ISO_VOLID="RELAXRECOVER")
vol_name becomes values like
RELAXRECOVER_01 RELAXRECOVER_02 ...
for which my simple "grep $vol_name" test should be
sufficiently fail-safe (i.e. no accidental false-positive match).
jsmeix commented at 2016-11-23 15:25:¶
In the rear recovery system based on SLE12
with some mounted CDs (actually virtual CDs
on a KVM/QEMU virtual machine i.e. using ISOs)
I get this results:
RESCUE d25:~ # blkid /dev/sr0: UUID="2016-11-23-15-12-54-00" LABEL="RELAXRECOVER" TYPE="iso9660" /dev/sr1: UUID="2016-11-23-15-12-52-00" LABEL="RELAXRECOVER_03" TYPE="iso9660" /dev/sr2: UUID="2016-11-23-15-12-49-00" LABEL="RELAXRECOVER_02" TYPE="iso9660" RESCUE d25:~ # for dev in sr0 sr1 sr2 ; do blkid /dev/${dev} | awk 'BEGIN{FS="[=\"]"} {print $3}' ; done 2016-11-23-15-12-54-00 2016-11-23-15-12-52-00 2016-11-23-15-12-49-00
jsmeix commented at 2016-11-23 15:36:¶
With
https://github.com/rear/rear/issues/1081
merged, I consider the issue to be fixed
(i.e. I do not expect regressions on non-SLE12 systems
because I assume my simplified blkid test also works
on non-SLE12 systems).
jsmeix commented at 2016-11-23 15:43:¶
Puuhh!
I feared my simple "grep $vol_name" test
is not sufficiently fail-safe because a plain
"grep RELAXRECOVER" would also match
for RELAXRECOVER_01 RELAXRECOVER_02 ...
but fortunately the blikid test does not happen
for the initial ISO that is labeled plain RELAXRECOVER.
The blikid test does only happen for the additional ISOs
that are labeled RELAXRECOVER_01 RELAXRECOVER_02 ...
cf. this excerpt from my "rear -d -D recover" log
in the recovered system:
e205:~ # grep 'grep -q RELAXRECOVER' /var/log/rear/recover/rear-d25.log | sort -u ++ grep -q RELAXRECOVER_01 ++ grep -q RELAXRECOVER_02 ++ grep -q RELAXRECOVER_03
[Export of Github issue for rear/rear.]