1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

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.
This commit is contained in:
Alasdair G Kergon 2013-08-13 18:20:11 +01:00
parent fd7cac15bc
commit 1a1d3a10ff
2 changed files with 7 additions and 0 deletions

View File

@ -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.

View File

@ -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;