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
LVM: specifying uuid for 'lvmdev' is optional when recovering. #1897
Conversation
Due to this, the 'grep' must be adjusted to not expect a trailing blank at the end of the line. This is typically used when migrating a PV to another disk while it already exists on the first disk. In such case, the uuid cannot be reused. Example of disklayout.conf line before removing the uuid: lvmdev /dev/rhel /dev/sda2 w6XFUx-DeeL-uAEY-0nEn-1A3o-pLp1-qcwYdO 12345678 When removing the uuid (and unused size), the current code was breaking if there was no trailing space: 'lvmdev /dev/rhel /dev/sda2 ' : OK 'lvmdev /dev/rhel /dev/sda2': BAD The new code also supports the second line, which is better for robustness.
@rmetrich In general since #1871 I think the root cause of issues with For example how # echo -e 'foo first this-that \nfoo second this ' | grep '^foo .* this ' foo second this # echo -e 'foo first this-that \nfoo second this ' | grep -w '^foo .* this' foo first this-that foo second this Simply put I like to verify that introducing |
@jsmeix the
|
My point is that all characters that are not letters, digits, or the underscore I assume traditional kernel device names like /dev/sda or /dev/sda1 With To stay on the safe side I would prefer to For example like # VAR="this" # echo -e 'foo first this-that \nfoo second this \nfoo third this-that\nfoo fourth this' | grep -E "^foo .* $VAR |^foo .* $VAR\$" foo second this foo fourth this (plus a comment in the code why that two cases can happen ;-) By the way: |
You're right, let me rework this. |
It seems on Friday my brain is already somewhat slow but # VAR="this" # echo -e 'foo first this-that \nfoo second this \nfoo third this-that\nfoo fourth this' | grep "^foo .* $VAR *$" foo second this foo fourth this i.e. specify the stuff after $VAR as none, one, or more spaces until the line ends. |
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.
Thank you!
@rear/contributors |
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.
looks ok to me
@rmetrich |
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 / New Feature / Enhancement / Other? Bug Fix
Impact: Low / Normal / High / Critical / Urgent Low
Reference to related issue (URL):
How was this pull request tested? Tested on RHEL 7 during LVM migration
Brief description of the changes in this pull request:
Due to this, the
grep
must be adjusted to not expect a trailing blank at the end of the line.This is typically used when migrating a PV to another disk while it already exists on the first disk. In such case, the uuid cannot be reused.
Example of disklayout.conf line before removing the uuid:
lvmdev /dev/rhel /dev/sda2 w6XFUx-DeeL-uAEY-0nEn-1A3o-pLp1-qcwYdO 12345678
When removing the uuid (and unused size), the current code was breaking if there was no trailing space:
lvmdev /dev/rhel /dev/sda2<space>
: OKlvmdev /dev/rhel /dev/sda2
: BADThe new code also supports the second line, which is better for robustness.