Bug 1732308 - Backport PR 2194
Summary: Backport PR 2194
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: rear
Version: ---
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: 8.2
Assignee: Pavel Cahyna
QA Contact: David Jež
URL:
Whiteboard:
Depends On: 1732328
Blocks: 1746915 1755139
TreeView+ depends on / blocked
 
Reported: 2019-07-23 07:10 UTC by Renaud Métrich
Modified: 2020-04-28 15:47 UTC (History)
2 users (show)

Fixed In Version: rear-2.4-11.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-28 15:47:07 UTC
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github rear rear issues 2187 0 'None' closed disklayout.conf file contains duplicate lines 2021-02-09 11:17:55 UTC
Github rear rear pull 2194 0 'None' closed Issue #2187 - disklayout.conf file contains duplicate lines 2021-02-09 11:17:56 UTC
Red Hat Product Errata RHBA-2020:1648 0 None None None 2020-04-28 15:47:26 UTC

Description Renaud Métrich 2019-07-23 07:10:28 UTC
Description of problem:

We need to backport Upstream PR https://github.com/rear/rear/pull/2194 to our ReaR-2.4 to fix an issue when recovering a system in Migration Mode (happens when a different system is used or disks have not same size) or when Thin Pools are used.
Without the fix, multiple "lvmvol" lines for same LV are added in disklayout.conf, causing multiple "lvcreate" commands for same LV to be used, which breaks the recovery.


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

rear-2.4


How reproducible:

Always


Steps to Reproduce:

1. Add 2 disks to an existing system (to enable creating stripes)

2. Create a VG with the disks

# vgcreate data /dev/sdb /dev/sdc

3. Create 2 LVs with segments

# lvcreate -n lv1 -L 1G data
# lvcreate -n lv2 -L 1G data
# lvextend /dev/data/lv1 -L +1G -i 2
# lvextend /dev/data/lv2 -L +1G -i 2
# lvextend /dev/data/lv1 -L +1G -i 1
# lvextend /dev/data/lv2 -L +1G -i 1

4. Format and mount the LVs

# mkdir -p /lv1 /lv2
# mkfs.ext4 /dev/data/lv1
# mkfs.ext4 /dev/data/lv2
# mount /dev/data/lv1 /lv1
# mount /dev/data/lv2 /lv2

5. Create rescue ISO

# rear mkrescue

6. Check /var/lib/rear/layout/disklayout.conf


Actual results:

(broken)
# lvmvol <volume_group> <name> <size(bytes)> <layout> [key:value ...]
lvmvol /dev/data lv1 3221225472b linear,striped stripes:1
lvmvol /dev/data lv1 3221225472b linear,striped stripesize:65536b stripes:2
lvmvol /dev/data lv1 3221225472b linear,striped stripes:1
lvmvol /dev/data lv2 2147483648b linear,striped stripes:1
lvmvol /dev/data lv2 2147483648b linear,striped stripesize:65536b stripes:2


Expected results:

(with the fix)
# lvmvol <volume_group> <name> <size(bytes)> <layout> [key:value ...]
# WARNING: Volume data/lv1 has multiple segments. Restoring it in Migration Mode using 'lvcreate' won't preserve segments and volume properties of the other segments!
lvmvol /dev/data lv1 3221225472b linear,striped segmentsize:1073741824b stripes:1
#lvmvol /dev/data lv1 3221225472b linear,striped stripesize:65536b segmentsize:1073741824b stripes:2
#lvmvol /dev/data lv1 3221225472b linear,striped segmentsize:1073741824b stripes:1
# WARNING: Volume data/lv2 has multiple segments. Restoring it in Migration Mode using 'lvcreate' won't preserve segments and volume properties of the other segments!
lvmvol /dev/data lv2 2147483648b linear,striped segmentsize:1073741824b stripes:1
#lvmvol /dev/data lv2 2147483648b linear,striped stripesize:65536b segmentsize:1073741824b stripes:2


Additional info:

When in Migration Mode or when recreating Thin Pools, the LV will be recreated using one segment only, which characteristics (e.g. "stripes") of the first segment only.
This is sub-optimal but too complicated to do differently.

Comment 1 Pavel Cahyna 2019-09-02 12:49:20 UTC
I would like to ask whether in light of bz1747468 it makes sense to fix this one or if rather a different approach to fix both is needed.

Comment 2 Renaud Métrich 2019-10-22 06:12:48 UTC
I would recommend fixing both with the current approach from Upstream for now.

Comment 6 errata-xmlrpc 2020-04-28 15:47:07 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, 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-2020:1648


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