Bug 771065 - lvconvert --splitmirrors allows invalid new volume name
Summary: lvconvert --splitmirrors allows invalid new volume name
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: lvm2
Version: 14
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Jonathan Earl Brassow
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-12-31 15:34 UTC by DaveG
Modified: 2012-04-11 12:47 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-04-11 12:47:50 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description DaveG 2011-12-31 15:34:59 UTC
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 2012-01-01 02:35:31 UTC
--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 12:47:50 UTC
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.