New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue #2187 - disklayout.conf file contains duplicate lines #2194
Conversation
Create the 'lvmvol' lines commented out when multiple segments exist for a given LV. This is not an issue unless Migration Mode is used. In such case, using 'lvcreate' commands already does best effort and loses LV information. Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rmetrich Looks good on first sight - will you also back-port this in RedHat's rear-2.4 package?
Do not overload the `kval` variable - intended for passing options to lvcreate - by adding extra keys to it, which are not supported by lvcreate. Introduce another variable `infokval` for this purpose and print those unsupported and purely informational keys only in comments.
|
|
||
| kval="" | ||
| [ -z "$thinpool" ] || kval="${kval:+$kval }thinpool:$thinpool" | ||
| [ $chunksize -eq 0 ] || kval="${kval:+$kval }chunksize:${chunksize}b" | ||
| [ $stripesize -eq 0 ] || kval="${kval:+$kval }stripesize:${stripesize}b" | ||
| [ $segmentsize -eq $size ] || kval="${kval:+$kval }segmentsize:${segmentsize}b" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, what? Abuse?
OK, I recognize I was lazy here :-) Thanks for the PR.
#1356 ## Relax-and-Recover (ReaR) Pull Request Template
Please fill in the following items before submitting a new pull request:
Pull Request Details:
Type: Bug Fix
Impact: Low
Reference to related issue (URL): disklayout.conf file contains duplicate lines #2187
How was this pull request tested? Tested on RHEL8 with multiple segments
Brief description of the changes in this pull request:
Create the 'lvmvol' lines commented out when multiple segments exist for a given LV.
This is not an issue unless Migration Mode is used.
In such case, using 'lvcreate' commands already does best effort and loses LV information.
Reproducer:
Add 2 disks to an existing system
Create a VG with the disks
Create 2 LVs with segments
Format and mount the LVs
Create rescue ISO
Check
/var/lib/rear/layout/disklayout.confWith the fix (see above), the other segments of the LV
lv1andlv2are created commented out, which allows the administrator to recreate them manually if needed.Note in particular that
lvcreatecode will create thelv1andlv2LVs with only 1 stripe, i.e. the number of stripes specified for the first segment only.