Bug 1925530

Summary: Cannot recreate volume group when using Raid on LVM
Product: Red Hat Enterprise Linux 7 Reporter: Renaud Métrich <rmetrich>
Component: rearAssignee: Pavel Cahyna <pcahyna>
Status: CLOSED MIGRATED QA Contact: CS System Management SST QE <rhel-cs-system-management-subsystem-qe>
Severity: high Docs Contact:
Priority: high    
Version: 7.9CC: ovasik, pcahyna
Target Milestone: rcKeywords: MigratedToJIRA
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-22 00:08:59 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:

Description Renaud Métrich 2021-02-05 13:07:42 UTC
Description of problem:

See Upstream PR https://github.com/rear/rear/pull/2564

When having a LV in Raid, and 2 PVs making the VG, an error occurs when re-creating the VG in case Migration mode is used, which usually is the default since having multiple disks with same size make ReaR do a mapping and enter Migration mode.

-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
Start system layout restoration.
Disk '/dev/vda': creating 'msdos' partition table
Disk '/dev/vda': creating partition number 1 with name 'primary'
Disk '/dev/vda': creating partition number 2 with name 'primary'
Creating LVM PV /dev/vdb
Creating LVM PV /dev/vdc
Creating LVM PV /dev/vda2
Creating LVM VG 'data'; Warning: some properties may not be preserved...
The disk layout recreation script failed
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Internally the failure happens because a "vgcreate" is used on the existing VG, no "vgremove" is ever performed.

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

All versions, including Upstream

How reproducible:


Steps to Reproduce:

1. Install a system

2. Add 2 additional disks that will be used to host a LVM VG with *same* size


3. Create a Raid volume

# pvcreate /dev/vdb
# pvcreate /dev/vdc
# vgcreate data /dev/vdb /dev/vdc
# lvcreate -n vol1 -L 1G -m 1 data
# mkfs.xfs /dev/data/vol1
# mount /dev/data/vol1 /mnt

4. Build a rescue image and perform a recovery

Actual results:


Expected results:

No failure

Additional info:

There is no easy workaround, the admin needs to edit the diskrestore.sh file.

Comment 2 Pavel Cahyna 2021-02-05 13:41:37 UTC
Does the problem occur only when restoring to disks that have existing data? If so, wouldn't it help to wipe the disks first before restoring to them?

Comment 3 Renaud Métrich 2021-02-05 14:21:01 UTC
Yes, only upon recovering an existing system.
Wiping works but requires manual intervention.

Comment 4 Pavel Cahyna 2021-02-05 15:05:20 UTC
This sounds like the case in bz1919989, which did not involve RAID. So I think the problem is not restricted to RAID.

Comment 5 Renaud Métrich 2021-02-05 15:31:43 UTC
Very likely indeed, I think this happens as soon as a volume group has multiple PVs on different disks.
What is really required is to have ReaR enter Migration mode. There is no issue with the `vgcfgrestore` way.

Comment 7 RHEL Program Management 2023-09-21 23:35:29 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 8 RHEL Program Management 2023-09-22 00:08:59 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.