From 72e0743621e9127cc4ea9f6fd735559f72f2e1ab Mon Sep 17 00:00:00 2001 From: Jonathan Earl Brassow Date: Fri, 8 Jan 2010 22:00:31 +0000 Subject: This patch adds the capability to split off a mirror legs. It is pretty much the same as reducing the number of mirror legs, but we just don't delete them afterwards. The following command line interface is enforced: prompt> lvconvert --splitmirror -n / where 'n' is the number of images to split off, and where 'name' is the name of the newly split off logical volume. If more than one leg is split off, a new mirror will be the result. The newly split off mirror will have a 'core' log. Example: [root@bp-01 LVM2]# !lvs lvs -a -o name,copy_percent,devices LV Copy% Devices lv 100.00 lv_mimage_0(0),lv_mimage_1(0),lv_mimage_2(0),lv_mimage_3(0) [lv_mimage_0] /dev/sdb1(0) [lv_mimage_1] /dev/sdc1(0) [lv_mimage_2] /dev/sdd1(0) [lv_mimage_3] /dev/sde1(0) [lv_mlog] /dev/sdi1(0) [root@bp-01 LVM2]# lvconvert --splitmirrors 2 --name split vg/lv /dev/sd[ce]1 Logical volume lv converted. [root@bp-01 LVM2]# !lvs lvs -a -o name,copy_percent,devices LV Copy% Devices lv 100.00 lv_mimage_0(0),lv_mimage_2(0) [lv_mimage_0] /dev/sdb1(0) [lv_mimage_2] /dev/sdd1(0) [lv_mlog] /dev/sdi1(0) split 100.00 split_mimage_0(0),split_mimage_1(0) [split_mimage_0] /dev/sde1(0) [split_mimage_1] /dev/sdc1(0) It can be seen that '--splitmirror ' is exactly the same as '--mirrors -' (note the minus sign), except there is the additional notion to keep the image being detached from the mirror instead of just throwing it away. Signed-off-by: Jonathan Brassow --- tools/args.h | 1 + 1 file changed, 1 insertion(+) (limited to 'tools/args.h') diff --git a/tools/args.h b/tools/args.h index 85f6a3cf..b41c275e 100644 --- a/tools/args.h +++ b/tools/args.h @@ -50,6 +50,7 @@ arg(nosync_ARG, '\0', "nosync", NULL, 0) arg(resync_ARG, '\0', "resync", NULL, 0) arg(corelog_ARG, '\0', "corelog", NULL, 0) arg(mirrorlog_ARG, '\0', "mirrorlog", string_arg, 0) +arg(splitmirrors_ARG, '\0', "splitmirrors", int_arg, 0) arg(repair_ARG, '\0', "repair", NULL, 0) arg(use_policies_ARG, '\0', "use-policies", NULL, 0) arg(monitor_ARG, '\0', "monitor", yes_no_arg, 0) -- cgit