Bug 771065 - lvconvert --splitmirrors allows invalid new volume name
lvconvert --splitmirrors allows invalid new volume name
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: lvm2 (Show other bugs)
14
x86_64 Linux
unspecified Severity high
: ---
: ---
Assigned To: Jonathan Earl Brassow
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-31 10:34 EST by DaveG
Modified: 2012-04-11 08:47 EDT (History)
12 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-04-11 08:47:50 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description DaveG 2011-12-31 10:34:59 EST
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):
lvm2-2.02.84-2.fc14.x86_64.rpm

How reproducible:
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
  ------------------------------^^^^^ Oops.

Actual results:
New LV fails activation leaving:
vgXX/lvXX
vgXX/lvXX_mimage_0
vgXX/lvXX_mlog
vgXX/vgXX/lvYY

LV "vgXX/vgXX/lvYY" is listed but none of the LVM tools will work with it.
LVM GUI crashes on start-up.

Expected results:
Error message at invocation and refuse to split off an invalid volume name.

Additional info:
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!

--DaveG.
Comment 1 Alasdair Kergon 2011-12-31 21:35:31 EST
--name accepts the vg/lv format

Sounds like lvconvert needs fixing to deal with the vg/ part appropriately.
Comment 2 Peter Rajnoha 2012-04-11 08:47:50 EDT
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

Note You need to log in before you can comment on or make changes to this bug.