Bug 1832394

Summary: rear silently fails to create usable backup with LUKS2
Product: Red Hat Enterprise Linux 8 Reporter: Chris Cheney <ccheney>
Component: rearAssignee: Vitezslav Crhonek <vcrhonek>
Status: CLOSED ERRATA QA Contact: David Jež <djez>
Severity: high Docs Contact: Prerana Sharma <presharm>
Priority: high    
Version: ---CC: djez, efedin, lmanasko, ovasik, pcahyna, pkhedeka
Target Milestone: rcKeywords: Triaged
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: rear-2.4-18.el8 Doc Type: Bug Fix
Doc Text:
.`ReaR` utility now restores system using `LUKS2` encrypted partition Previously, when at least one `LUKS2` encrypted partition was present on the system to backup with Relax-and-Recover (`Rear`) utility, the user was not informed that ReaR does not support `LUKS2` encrypted partition. Consequently, the `ReaR` utility was unable to recreate the original state of the system during the restore phase. With this update, support of basic `LUKS2` configuration, error checking, and improved output has been added to the `ReaR` utility. The `ReaR` utility now restores systems using basic `LUKS2` encrypted partitions or notifies users in the opposite case.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-18 16:03:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
backported upstream code
none
proposed fix none

Description Chris Cheney 2020-05-06 16:23:57 UTC
Rear is unable to properly backup LUKS2 volumes and currently does not complain that it did not do so correctly.

There is an upstream bug about this already.

   https://github.com/rear/rear/issues/2204

Also there is a patch to report error to backup until the underlying issue is corrected.

   https://github.com/rear/rear/pull/2381

Comment 1 Pavel Cahyna 2020-05-06 17:11:21 UTC
From a quick look at the issue, it seems that ReaR backs up the data properly, and then fails to recreate the disk layout during restore, right? I.e. data are not lost and could be in principle restored in another way. (I am not trying to say that the issue does not matter, just trying to understand the impact and cause and possible workarounds.)

Comment 6 Vitezslav Crhonek 2020-10-13 11:26:15 UTC
Improved version of patch from PR#2381 is available in PR#2493.

    https://github.com/rear/rear/pull/2493

It doesn't report error when creating backup but just warns user that usage
of unsupported version of LUKS was detected. ReaR then adds commented out
"crypt" entry to disklayout.conf and finishes the backup as usual.

During the recover phase, user can edit disklayout.conf, uncomment "crypt"
entry and provide correct values there. I was able to successfully complete
the system recovery in this manner.

Comment 7 Vitezslav Crhonek 2020-10-14 07:17:12 UTC
Created attachment 1721409 [details]
backported upstream code

Comment 8 Vitezslav Crhonek 2020-11-02 09:21:22 UTC
Upstream has merged initial support of LUKS2 from PR#2504:

    https://github.com/rear/rear/pull/2504

Comment 9 Vitezslav Crhonek 2020-11-25 08:47:27 UTC
Created attachment 1733293 [details]
proposed fix

Comment 24 errata-xmlrpc 2021-05-18 16:03:02 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (rear bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:1910