LVM2 ./WHATS_NEW lib/metadata/metadata-exporte ...
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: jbrassow at sourceware.org 2011-10-07 14:56:01
Modified files:
. : WHATS_NEW lib/metadata : metadata-exported.h raid_manip.c test : t-lvconvert-raid.sh tools : lvconvert.c
Log message:
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
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2151&r2=1.2152
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata-exported.h.diff?cvsroot=lvm2&r1=1.213&r2=1.214
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/raid_manip.c.diff?cvsroot=lvm2&r1=1.16&r2=1.17
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-lvconvert-raid.sh.diff?cvsroot=lvm2&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.173&r2=1.174
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.89 - ================================== + Add ability to convert mirror segtype to RAID1 segtype. Add ability to convert from linear to RAID1. Add ability to extend mirrors with '--nosync' option. Fix splitmirror in cluster having different DM/LVM views of storage.
lib/metadata/metadata-exported.h +2 -0
@@ -770,6 +770,8 @@int lv_raid_split_and_track (struct logical_volume *lv,struct dm_list *splittable_pvs);int lv_raid_merge (struct logical_volume *lv); +int lv_raid_reshape (struct logical_volume *lv, +const struct segment_type *new_segtype);/* -- metadata/raid_manip.c */
lib/metadata/raid_manip.c +173 -9
238 lines not on this page · raw message
test/t-lvconvert-raid.sh +42 -13
112 lines not on this page · raw message
tools/lvconvert.c +3 -0
@@ -1452,6 +1452,9 @@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 ; }