Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f5cc96a54e9563b8…
Commit: f5cc96a54e9563b8aa5445a049facbe30a59fb39
Parent: 321e19d9cc868ae475ea1a0a4b026bf5b84ccd5a
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Mar 10 09:38:43 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Mar 10 09:38:43 2015 -0500
WHATS_NEW vgconvert -M fix
---
WHATS_NEW | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 680879d..b4fd415 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.118 -
=================================
+ Disallow vgconvert from changing metadata format when lvmetad is used.
Don't do a full read of VG when creating a new VG with an existing name.
Reduce number of VG metadata parsing when looking for vgname on a PV.
Avoid reparsing same metadata when reading same metadata from multiple PVs.
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=321e19d9cc868ae4…
Commit: 321e19d9cc868ae475ea1a0a4b026bf5b84ccd5a
Parent: 5dbcbbea58508854904dafe054945ea48baa1642
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Mar 10 09:31:54 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Mar 10 09:31:54 2015 -0500
vgconvert: require lvmetad to not be used
lvmetad does not work with lvm1/format1 metadata,
and vgconvert -M converts to or from lvm1 metadata,
so disallow vgconvert -M when lvmetad is used.
---
tools/vgconvert.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/tools/vgconvert.c b/tools/vgconvert.c
index 3742237..c4bb37a 100644
--- a/tools/vgconvert.c
+++ b/tools/vgconvert.c
@@ -214,6 +214,11 @@ int vgconvert(struct cmd_context *cmd, int argc, char **argv)
return EINVALID_CMD_LINE;
}
+ if (arg_is_set(cmd, metadatatype_ARG) && lvmetad_used()) {
+ log_error("lvmetad must be disabled to change metadata types.");
+ return EINVALID_CMD_LINE;
+ }
+
if (arg_int_value(cmd, labelsector_ARG, 0) >= LABEL_SCAN_SECTORS) {
log_error("labelsector must be less than %lu",
LABEL_SCAN_SECTORS);
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=458b0210d1b41951…
Commit: 458b0210d1b4195171992f112aeb3a798d4509a3
Parent: 1334ea214ea1f55173f2ff7e3045cc72a8c4e7c7
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Mon Mar 9 19:03:11 2015 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Mon Mar 9 19:03:11 2015 +0000
vgchange: Additional system ID warnings.
Also prompt before setting a system ID on a VG when none is set
on the host.
Put quotes round system ID in messages where it could be blank.
---
tools/vgchange.c | 57 ++++++++++++++++++++++++++++-------------------------
1 files changed, 30 insertions(+), 27 deletions(-)
diff --git a/tools/vgchange.c b/tools/vgchange.c
index 36b44a9..88a85d8 100644
--- a/tools/vgchange.c
+++ b/tools/vgchange.c
@@ -536,42 +536,45 @@ static int _vgchange_system_id(struct cmd_context *cmd, struct volume_group *vg)
}
if (!strcmp(vg->system_id, system_id)) {
- log_error("Volume Group system ID is already %s", vg->system_id);
+ log_error("Volume Group system ID is already \"%s\".", vg->system_id);
return 0;
}
- if (cmd->system_id && strcmp(system_id, cmd->system_id)) {
- if (!*system_id) {
- log_warn("WARNING: Removing the system ID allows unsafe access from other hosts.");
+ if (!*system_id && cmd->system_id && strcmp(system_id, cmd->system_id)) {
+ log_warn("WARNING: Removing the system ID allows unsafe access from other hosts.");
- if (!arg_count(cmd, yes_ARG) &&
- yes_no_prompt("Remove system ID %s on volume group %s? [y/n]: ",
- vg->system_id, vg->name) == 'n') {
- log_error("Volume group %s system ID not changed.", vg->name);
- return 0;
- }
- } else {
- if (lvs_in_vg_activated(vg)) {
- log_error("Logical Volumes in VG %s must be deactivated before system ID can be changed.",
- vg->name);
- return 0;
- }
+ if (!arg_count(cmd, yes_ARG) &&
+ yes_no_prompt("Remove system ID %s from volume group %s? [y/n]: ",
+ vg->system_id, vg->name) == 'n') {
+ log_error("System ID of volume group %s not changed.", vg->name);
+ return 0;
+ }
+ }
- log_warn("WARNING: Requested system ID %s does not match local system ID %s",
- system_id, cmd->system_id);
- log_warn("WARNING: Volume group %s might become inaccessible from this machine.",
- vg->name);
+ if (*system_id && (!cmd->system_id || strcmp(system_id, cmd->system_id))) {
+ if (lvs_in_vg_activated(vg)) {
+ log_error("Logical Volumes in VG %s must be deactivated before system ID can be changed.",
+ vg->name);
+ return 0;
+ }
- if (!arg_count(cmd, yes_ARG) &&
- yes_no_prompt("Set foreign system ID %s on volume group %s? [y/n]: ",
- system_id, vg->name) == 'n') {
- log_error("Volume group %s system ID not changed.", vg->name);
- return 0;
- }
+ if (cmd->system_id)
+ log_warn("WARNING: Requested system ID %s does not match local system ID %s.",
+ system_id, cmd->system_id ? : "");
+ else
+ log_warn("WARNING: No local system ID is set.");
+ log_warn("WARNING: Volume group %s might become inaccessible from this machine.",
+ vg->name);
+
+ if (!arg_count(cmd, yes_ARG) &&
+ yes_no_prompt("Set foreign system ID %s on volume group %s? [y/n]: ",
+ system_id, vg->name) == 'n') {
+ log_error("Volume group %s system ID not changed.", vg->name);
+ return 0;
}
}
- log_verbose("Changing system ID for VG %s from %s to %s.",
+ log_verbose("Changing system ID for VG %s from \"%s\" to \"%s\".",
vg->name, vg->system_id, system_id);
vg->system_id = system_id;
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1334ea214ea1f551…
Commit: 1334ea214ea1f55173f2ff7e3045cc72a8c4e7c7
Parent: a8545462349c560cf66362cb3d25b44b7b0e819b
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Mon Mar 9 19:01:12 2015 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Mon Mar 9 19:01:12 2015 +0000
vgconvert: Check system ID compatibility.
If system ID is set, don't switch to a format that doesn't support it.
---
tools/vgconvert.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/tools/vgconvert.c b/tools/vgconvert.c
index 50b3e44..3742237 100644
--- a/tools/vgconvert.c
+++ b/tools/vgconvert.c
@@ -94,6 +94,13 @@ static int vgconvert_single(struct cmd_context *cmd, const char *vg_name,
return ECMD_FAILED;
}
+ /* New-style system ID supported? */
+ if (vg->system_id && *vg->system_id && (cmd->fmt->features & FMT_SYSTEMID_ON_PVS)) {
+ log_error("Unable to convert VG %s while it has a system ID set (%s).", vg->name,
+ vg->system_id);
+ return ECMD_FAILED;
+ }
+
/* Attempt to change any LVIDs that are too big */
if (cmd->fmt->features & FMT_RESTRICTED_LVIDS) {
dm_list_iterate_items(lvl, &vg->lvs) {