From c27dc4e75756ec7d2a97effe0e3aed5050c87176 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Thu, 18 Nov 2004 19:45:53 +0000 Subject: Improve a vgremove error message. --- tools/vgremove.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'tools/vgremove.c') diff --git a/tools/vgremove.c b/tools/vgremove.c index 1c5553de..7b85e207 100644 --- a/tools/vgremove.c +++ b/tools/vgremove.c @@ -23,8 +23,11 @@ static int vgremove_single(struct cmd_context *cmd, const char *vg_name, struct pv_list *pvl; int ret = ECMD_PROCESSED; - if (!vg || !consistent) { - log_error("Volume group \"%s\" doesn't exist", vg_name); + if (!vg || !consistent || (vg->status & PARTIAL_VG)) { + log_error("Volume group \"%s\" not found or inconsistent.", + vg_name); + log_error("Consider vgreduce --removemissing if metadata " + "is inconsistent."); return ECMD_FAILED; } @@ -33,12 +36,6 @@ static int vgremove_single(struct cmd_context *cmd, const char *vg_name, return ECMD_FAILED; } - if (vg->status & PARTIAL_VG) { - log_error("Cannot remove partial volume group \"%s\"", - vg->name); - return ECMD_FAILED; - } - if (vg->lv_count) { log_error("Volume group \"%s\" still contains %d " "logical volume(s)", vg_name, vg->lv_count); -- cgit