main - vgmerge: support option --poolmetadataspare
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=4b856476e96777842ea6c9b42654c369a6b22db4 Commit: 4b856476e96777842ea6c9b42654c369a6b22db4 Parent: 9cbc9e8296752df35626a9b50de1cb551ff5e99e Author: Zdenek Kabelac <[email protected]> AuthorDate: Fri Jul 23 16:32:35 2021 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Fri Jul 23 16:36:31 2021 +0200
vgmerge: support option --poolmetadataspare
--- WHATS_NEW | 2 +- man/vgmerge.8_pregen | 9 +++++++++ tools/command-lines.in | 2 +- tools/vgmerge.c | 6 ++++++ 4 files changed, 17 insertions(+), 2 deletions(-)
WHATS_NEW +1 -1
@@ -1,6 +1,6 @@ Version 2.03.13 - =============================== - Support --poolmetadataspare with vgsplit. + Support --poolmetadataspare with vgsplit and vgmerge. Fix detection of active components of external origin volume. Add vdoimport tool to support conversion of VDO volumes. Support configurable allocation/vdo_pool_header_size.
man/vgmerge.8_pregen +9 -0
@@ -27,6 +27,8 @@ of both VGs fit into the destination VG's limits. .br [ \fB-l\fP|\fB--list\fP ] .br +[ \fB--poolmetadataspare\fP \fBy\fP|\fBn\fP ] +.br [ COMMON_OPTIONS ] .ad b .RE
@@ -147,6 +149,13 @@ Display long help text. Disable locking. . .HP +\fB--poolmetadataspare\fP \fBy\fP|\fBn\fP +.br +Enable or disable the automatic creation and management of a +spare pool metadata LV in the VG. A spare metadata LV is reserved +space that can be used when repairing a pool. +. +.HP \fB--profile\fP \fIString\fP .br An alias for --commandprofile or --metadataprofile, depending
tools/command-lines.in +1 -1
@@ -1847,7 +1847,7 @@ DESC: Add devices from all accessible VGs to the devices file. --- vgmerge VG VG -OO: --autobackup Bool, --list +OO: --autobackup Bool, --list, --poolmetadataspare Bool ID: vgmerge_general ---
tools/vgmerge.c +6 -0
@@ -64,6 +64,8 @@ static int _vgmerge_single(struct cmd_context *cmd, const char *vg_name_to,struct lv_list *lvl1, *lvl2;int r =ECMD_FAILED ;int lock_vg_from_first =0 ; +struct logical_volume *lv; +int poolmetadataspare =arg_int_value (cmd, poolmetadataspare_ARG,DEFAULT_POOL_METADATA_SPARE );if (!strcmp (vg_name_to, vg_name_from)) {log_error ("Duplicate volume group name \"%s\"" , vg_name_from);
@@ -185,6 +187,10 @@ static int _vgmerge_single(struct cmd_context *cmd, const char *vg_name_to,/* Flag up that some PVs have moved from another VG */ vg_to->old_name = vg_from->name; +/* Check whether size of pmspare is big enough now for merged VG */ +if (!handle_pool_metadata_spare (vg_to,0 , &vg_to->pvs, poolmetadataspare)) + goto_bad; +/* store it on disks */ log_verbose ("Writing out updated volume group" );if (!vg_write (vg_to) || !vg_commit (vg_to))