Version 2.02.107 -
==================================
+ Make vgsplit fail cleanly when not all PVs are specified for RAID 4/5/6.
Make vgsplit work on mirrors with logs that share PVs with images.
Use devices/ignore_suspended_devices=0 by default if not defined in lvm.conf.
Use proper libmem mempool for allocation of unknown segment name.
lvcreate -an -Zn -l 64 --type raid5 -i 2 -n $lv1 $vg1
if [ $j = PV ]; then
-# not vgsplit $vg1 $vg2 "$dev1"
-# not vgsplit $vg1 $vg2 "$dev2"
-# not vgsplit $vg1 $vg2 "$dev1" "$dev2"
+ not vgsplit $vg1 $vg2 "$dev1"
+ not vgsplit $vg1 $vg2 "$dev2"
+ not vgsplit $vg1 $vg2 "$dev1" "$dev2"
vgsplit $vg1 $vg2 "$dev1" "$dev2" "$dev3"
else
vgsplit -n $lv1 $vg1 $vg2
if ((lv->status & SNAPSHOT))
continue;
+ if (lv_is_raid(lv))
+ continue;
+
if ((lv->status & MIRRORED))
continue;
dm_list_iterate_safe(lvh, lvht, &vg_from->lvs) {
lv = dm_list_item(lvh, struct lv_list)->lv;
+ if (lv_is_raid(lv))
+ continue;
+
if (!(lv->status & MIRRORED))
continue;
return 1;
}
+static int _move_raid(struct volume_group *vg_from,
+ struct volume_group *vg_to)
+{
+ struct dm_list *lvh, *lvht;
+ struct logical_volume *lv;
+ struct lv_segment *seg;
+ unsigned s, seg_in;
+
+ dm_list_iterate_safe(lvh, lvht, &vg_from->lvs) {
+ lv = dm_list_item(lvh, struct lv_list)->lv;
+
+ if (!lv_is_raid(lv))
+ continue;
+
+ seg = first_seg(lv);
+
+ seg_in = 0;
+ for (s = 0; s < seg->area_count; s++) {
+ if (_lv_is_in_vg(vg_to, seg_lv(seg, s)))
+ seg_in++;
+ if (_lv_is_in_vg(vg_to, seg_metalv(seg, s)))
+ seg_in++;
+ }
+
+ if (seg_in && seg_in != (seg->area_count * 2)) {
+ log_error("Can't split RAID %s between "
+ "two Volume Groups", lv->name);
+ return 0;
+ }
+
+ if (!_move_one_lv(vg_from, vg_to, lvh))
+ return_0;
+ }
+
+ return 1;
+}
+
static int _move_thins(struct volume_group *vg_from,
struct volume_group *vg_to)
{
goto_bad;
/* FIXME Separate the 'move' from the 'validation' to fix dev stacks */
+ /* Move required RAID across */
+ if (!(_move_raid(vg_from, vg_to)))
+ goto_bad;
+
/* Move required mirrors across */
if (!(_move_mirrors(vg_from, vg_to)))
goto_bad;