Gitweb:
http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1a1d3a10ffde42...
Commit: 1a1d3a10ffde42665b824a5c72bd526cb962ec1d
Parent: fd7cac15bcc4fe2a6036b4408a8c53d003a6859f
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Tue Aug 13 18:20:11 2013 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Aug 13 18:20:11 2013 +0100
vgchange: require confirmation with -c and no VGs
Too many people have been running 'vgchange -cy' by mistake
so add a confirmation prompt. Use --yes to bypass this.
---
WHATS_NEW | 1 +
tools/vgchange.c | 6 ++++++
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index b1f379b..49360b2 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.101 -
===================================
+ Require confirmation for vgchange -c when no VGs listed explicitly.
Also skip /var and /var/log by default in blkdeactivate when unmounting.
Add support for bind mounts in blkdeactivate.
Add blkdeactivate -v/--verbose for debug output from external tools used.
diff --git a/tools/vgchange.c b/tools/vgchange.c
index d41ef49..4087fab 100644
--- a/tools/vgchange.c
+++ b/tools/vgchange.c
@@ -623,6 +623,12 @@ int vgchange(struct cmd_context *cmd, int argc, char **argv)
return ECMD_PROCESSED;
}
+ if (arg_count(cmd, clustered_ARG) && !argc && !arg_count(cmd, yes_ARG)
&&
+ (yes_no_prompt("Change clustered property of all volumes groups? [y/n]: ")
== 'n')) {
+ log_error("No volume groups changed.");
+ return ECMD_FAILED;
+ }
+
if (!update || !update_partial_unsafe)
cmd->handles_missing_pvs = 1;