#1063 Issue closed: Let "rear recover" check first if the same disks exists based on HW IDs

Labels: enhancement, bug, needs sponsorship, no-issue-activity

jsmeix opened issue at 2016-11-10 08:50:

See
https://github.com/rear/rear/issues/1057#issuecomment-259460160
where @schabrolles wrote

I think we should check first if the same disk exists
based on HW ID,
If we can't find the same HW ID, use the size
to get the best candidate disk (like rear is doing today)

When restoring on same hardware, we should keep
exactly the same disks.
When restoring on different hardware, find the best disk
to map based on size.

Background information:
First and foremost "rear recover" is intended to work
on replacement hardware where any hardware specific IDs
are usually different compared to the original system where
"rear mkbackup" was run so that in general hardware specific IDs
cannot be used during "rear recover".
Therefore "rear recover" uses usually the plain kernel device nodes
like /dev/sda and /dev/sdb (in particular on new replacement disks
there are usually no labels that can be used - only the plain empty
disks exists).
Using plain kernel device nodes works sufficiently well in most cases
except exceptional cases where kernel device nodes like /dev/sda
and /dev/sdb could get interchanged on replacement hardware
compared to the original system, cf.
https://github.com/rear/rear/issues/1057

jsmeix commented at 2016-11-10 09:07:

This enhancement request requires major
implementation work.

The intent behind the following implementation proposal
is to only add functionality to ReaR and to avoid to change
what currently works o.k. in ReaR so that there are no
incompatible behavioural changes in ReaR:

During "rear mkbackup" hardware specific IDs
must be collected and stored in disklayout.conf.

During "rear recover" each hardware specific ID
in disklayout.conf must be checked if exists and
if yes the matching kernel device node must be noted
otherwise some fallback mechanism (e.g. disk size)
must be used to deterime the kernel device node.
E.g. think about recovery on a system with two same disks
/dev/sda and /dev/sdb where one disk got damaged and
was replaced by a new one (e.g /dev/sdb was replaced
by a new and bigger one).
In such a case "rear recover" should detect that /dev/sda
is still the same and only /dev/sdb is new.

disklayout.conf must be adapted to use the currently
right kernel device nodes that were determined in step 2.

Now the rest can work as before (using kernel device nodes)
i.e. the diskrestore.sh script will still use kernel device nodes
as it worked all the time before (but now it uses the currently
right kernel device nodes that were determined in step 2.)

jsmeix commented at 2016-11-10 09:10:

I set "looking for sponsorship" because I think in the
foreseeable future I will not find time to implement that myself.

Therefore I would very much appreciate if a ReaR contributor
could contibute a first usable implementation as GitHub
pull request so that we have a reasonable starting point.

Then it is much more likely that I find some time to further
adapt and enhace that initial starting point.

jsmeix commented at 2016-11-10 09:13:

I assign it to me which does not mean I will implement it myself
but it means I will keep having a look what goes on here...

github-actions commented at 2020-07-02 01:33:

Stale issue message


[Export of Github issue for rear/rear.]