Bug 2000593 - Signatures are not always wiped during recovery
Summary: Signatures are not always wiped during recovery
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: rear
Version: 8.4
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Pavel Cahyna
QA Contact: David Jež
Šárka Jana
URL:
Whiteboard:
Depends On: 2104005
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-09-02 13:07 UTC by Renaud Métrich
Modified: 2022-11-08 11:09 UTC (History)
3 users (show)

Fixed In Version: rear-2.6-5.el8
Doc Type: No Doc Update
Doc Text:
Clone Of:
: 2104005 (view as bug list)
Environment:
Last Closed: 2022-11-08 10:02:43 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github rear rear issues 2820 0 None closed wipefs will fail - Follow-up error: "/var/lib/rear/layout/diskrestore.sh: line 280: 3560 Aborted (core dumped)" 2022-07-05 14:28:18 UTC
Github rear rear pull 2827 0 None Merged Use fail-safe 'yes' pipe for "lvm lvcreate" 2022-07-05 14:28:14 UTC
Github rear rear pull 2834 0 None Merged Add yes to REQUIRED_PROGS 2022-07-05 14:27:54 UTC
Github rear rear pull 2839 0 None Merged Pass -y to lvcreate instead of piping the output of yes 2022-07-28 18:23:00 UTC
Red Hat Issue Tracker RHELPLAN-95997 0 None None None 2021-09-02 13:10:35 UTC
Red Hat Product Errata RHBA-2022:7654 0 None None None 2022-11-08 10:02:50 UTC

Description Renaud Métrich 2021-09-02 13:07:50 UTC
Description of problem:

In migration mode, the diskrestore.sh command has "lvcreate" lines, such as the one below:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
lvm lvcreate -L 1048576000b -n foolv foovg <<< y
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

The "<<< y" is used to wipe the file system signature, if any is found.

Unfortunately this doesn't always work, in particular when 2 signatures are found at different places:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
WARNING: xfs_external_log signature detected on /dev/foovg/foolv at offset 40960. Wipe it? [y/n]:   Wiping xfs_external_log signature on /dev/foovg/foolv.
WARNING: xfs_external_log signature detected on /dev/foovg/foolv at offset 45056. Wipe it? [y/n]: [n]
  Aborted wiping of xfs_external_log.
  1 existing signature left on the device.

-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

The solution is to use "-y" to "lvcreate" instead.


Version-Release number of selected component (if applicable):

rear-2.4 (RHEL7+8) but also Upstream


How reproducible:

Don't know, a cust got this, I always only have 1 signature.

Comment 1 Pavel Cahyna 2021-09-02 13:29:00 UTC
I think the same problem is reported in bz1974855 comment 7

This looks similar to bugs reported as bz1925531 and bz1919989, although happening at a different place. 

I wonder whether it is really worth investigating how to wipe old data on disks reliably, instead of just documenting that disks to restore to shall be clean.

Comment 2 Renaud Métrich 2021-09-02 14:09:50 UTC
"documenting that disks to restore to shall be cleadocumenting that disks to restore to shall be clean"

--> this will never happen in real life, also for unattended restores wiping is necessary.

Comment 3 Pavel Cahyna 2021-09-02 14:17:17 UTC
Btw, ReaR on S/390 takes a sledgehammer approach to disk wiping: it unconditionally performs a low level format (dasdfmt) of all available disks, even those that do not contain the system to be restored: bz1868421 comment 24. While it avoids issues as those, I consider it quite dangerous and would lile to submit a PR to remove this step. What do you think?

Comment 4 Renaud Métrich 2021-09-02 18:46:23 UTC
Right, performing a low level format may be dangerous.

Comment 5 Pavel Cahyna 2021-09-09 19:20:16 UTC
Thanks for the report and investigation, I will try to propose a change upstream to pass "-y" to the appropriate commands.

In the meantime, I suppose that using "wipefs" on the disks before calling ReaR might be a workaround.

Comment 16 errata-xmlrpc 2022-11-08 10:02:43 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-2022:7654


Note You need to log in before you can comment on or make changes to this bug.