From 15da467b52465076a8d587b94cc638bab8a0a95c Mon Sep 17 00:00:00 2001 From: David Teigland Date: Wed, 15 Jun 2016 14:19:18 -0500 Subject: [PATCH] pvscan: do activation when lvmetad is not running When pvscan --cache -aay fails to connect to lvmetad it will simply exit and do nothing. Change this so that it will skip the lvmetad cache step and do the activation step from disk. --- tools/pvscan.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/pvscan.c b/tools/pvscan.c index 3e9efefd6..5987e8b78 100644 --- a/tools/pvscan.c +++ b/tools/pvscan.c @@ -315,7 +315,7 @@ static int _pvscan_cache(struct cmd_context *cmd, int argc, char **argv) dm_list_init(&found_vgnames); dm_list_init(&pp.changed_vgnames); - if (!lvmetad_used()) { + if (!lvmetad_used() && !arg_is_set(cmd, activate_ARG)) { log_verbose("Ignoring pvscan --cache command because lvmetad is not in use."); return ret; } @@ -341,6 +341,13 @@ static int _pvscan_cache(struct cmd_context *cmd, int argc, char **argv) return ECMD_FAILED; } + if (!lvmetad_used() && do_activate) { + log_verbose("Activating all VGs without lvmetad running."); + all_vgs = 1; + devno_args = 0; + goto activate; + } + /* * Scan all devices when no args are given. */ -- 2.43.5