Skip to content
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

lvmvol with dashes #88

Closed
wdpoorte opened this issue May 31, 2012 · 7 comments
Closed

lvmvol with dashes #88

wdpoorte opened this issue May 31, 2012 · 7 comments
Assignees
Labels
bug The code does not do what it is meant to do
Milestone

Comments

@wdpoorte
Copy link

If a system has logical volumes with dashes, the translation is not done correctly from the /dev/vg/lv name to the /dev/mapper device name and vice versa. lvmgrps with dashes are working fine.

I think the code need to be adapted on the folowing locations:

/usr/share/rear/layout/save/default/33_remove_exclusions.sh:34:            vg=${dm_vg/--/-}
/usr/share/rear/layout/prepare/GNU/Linux/11_include_lvm_code.sh:98:    vg=${dm_vg/--/-}
/usr/share/rear/layout/prepare/default/31_remove_exclusions.sh:34:            vg=${dm_vg/--/-}
/usr/share/rear/lib/layout-functions.sh:115:                dm_vgrp=${vgrp/-/--}
@dagwieers
Copy link
Contributor

Can you provide an example of what was incorrectly translated. I noticed that for example it only replaces one instance, while we probably should replace all instances. So it should become vg=${dm_vg//--/-}, but I am not sure this is the problem you are having ?

@wdpoorte
Copy link
Author

I tested with /dev/vg-02/lv-test (/dev/mapper/vg--02-lv--test). The vg part is correctly translated, the lv part not.
If I rename the lv without dashes, it works correctly.
And indeed you're right that you should translate all dashes.

@dagwieers
Copy link
Contributor

@jhoekx Do you see a cause for this problem ?

@jhoekx
Copy link
Contributor

jhoekx commented May 31, 2012

Your commit af92078 fixes it, no?

Just never tested with a dash in both vg and lv.

@dagwieers
Copy link
Contributor

@wdpoorte Can you confirm that only this fixes it ? I thought the problem was that the LV part was never translated.

@ghost ghost assigned dagwieers May 31, 2012
@dagwieers
Copy link
Contributor

@wdpoorte We assume that this issue is fixed now. If this is not the case, please reopen this issue with more detailed information.

@wdpoorte
Copy link
Author

wdpoorte commented Jun 4, 2012

I cannot reopen (no permissions) and did not test yet (no time), but can already say this will not fix the issue. In case of a volume group name with more that 1 dash, this will correct this.
If we however have a logical volume with a dash, the problem is not fixed.

We now have this:

    name=${1#/dev/mapper/}
    dm_vg=${name%-*}
    # Device mapper doubles dashes
    vg=${dm_vg//--/-}
    lv=${name##*-}

but I think we should have this:

    name=${1#/dev/mapper/}
    dm_vg=${name%-*}
    # Device mapper doubles dashes
    vg=${dm_vg//--/-}
    dm_lv=${name##*-}
    lv=${dm_lv//--/-}

jhoekx pushed a commit to jhoekx/rear that referenced this issue Jun 7, 2012
Fix problems with LVM double-dashes (fixes rear#88)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The code does not do what it is meant to do
Projects
None yet
Development

No branches or pull requests

3 participants