Red Hat Bugzilla – Bug 771065
lvconvert --splitmirrors allows invalid new volume name
Last modified: 2012-04-11 08:47:50 EDT
Description of problem:
Tried using mirror and split mirror to back up a running system before upgrade (f14->f16) and tripped over this problem. lvconvert does not validate the new volume name before starting the mirror split. If you mistakenly include the volume group in the new volume name then the split-off volume is there but completely unusable and inaccessible.
Version-Release number of selected component (if applicable):
Just follow my mistake!
Steps to Reproduce:
0. Take a copy of the VG configuration!!!
vgcfgbackup -f vgXX.good -v vgXX
1. Create a test logical volume on a machine with three or more disks.
2. Convert to a mirrored volume.
lvconvert --mirrors 1 --alloc contiguous vgXX/lvXX /dev/sdXN /dev/sdYN
3. Split the mirror to create a new volume with a bad name.
lvconvert --splitmirrors 1 -n vgXX/lvYY vgXX/lvXX /dev/sdXN
New LV fails activation leaving:
LV "vgXX/vgXX/lvYY" is listed but none of the LVM tools will work with it.
LVM GUI crashes on start-up.
Error message at invocation and refuse to split off an invalid volume name.
Do not test on a valuable system!
Use vgcfgbackup before testing and use vgcfgrestore after to unwind the changes, or manually edit a configuration and restore. That's the only way I could restore sanity!
--name accepts the vg/lv format
Sounds like lvconvert needs fixing to deal with the vg/ part appropriately.
Fixed in lvm2 v2.02.96: "Detect VG name being part of the LV name in lvconvert --splitmirrors -n.", https://www.redhat.com/archives/lvm-devel/2012-March/msg00189.html