diff options
author | Jonathan Earl Brassow <jbrassow@redhat.com> | 2011-10-07 14:56:01 +0000 |
---|---|---|
committer | Jonathan Earl Brassow <jbrassow@redhat.com> | 2011-10-07 14:56:01 +0000 |
commit | f60175c30816700c2bf03a614371ac826d6e8d85 (patch) | |
tree | 1f82a894043bf9b2605ab8427179e1f2e5cbdef3 /tools/lvconvert.c | |
parent | d3582e025277861ef184e7a5d099f6e7138a7dce (diff) | |
download | lvm2-f60175c30816700c2bf03a614371ac826d6e8d85.tar.gz lvm2-f60175c30816700c2bf03a614371ac826d6e8d85.tar.xz lvm2-f60175c30816700c2bf03a614371ac826d6e8d85.zip |
Add the ability to convert LVs of "mirror" segtype to "raid1" segtype.
Example:
~> lvconvert --type raid1 vg/mirror_lv
Steps to convert "mirror" to "raid1"
1) Allocate a RAID metadata LV for each mirror image from the same PVs
on which they are located.
2) Clear the metadata LVs. This involves writing LVM metadata, so we don't
change any aspects of the mirror LV before this so that the user can easily
remove LVs from the failed convert attempt while retaining the original
mirror.
3) Remove the mirror log, if it exists.
4) Add metadata LVs to mirror LV
5) Rename mirror sub-lvs (s/mimage/rimage/)
6) Change flags and segtype from mirror to raid1
Diffstat (limited to 'tools/lvconvert.c')
-rw-r--r-- | tools/lvconvert.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/lvconvert.c b/tools/lvconvert.c index ff200ebc..0c423ebf 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -1452,6 +1452,9 @@ static int lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *lp if (arg_count(cmd, mirrors_ARG)) return lv_raid_change_image_count(lv, image_count, lp->pvh); + if (arg_count(cmd, type_ARG)) + return lv_raid_reshape(lv, lp->segtype); + log_error("Conversion operation not yet supported."); return 0; } |