diff --git a/man/vgremove.8 b/man/vgremove.8 index 997b90f19..0f2d9e9fe 100644 --- a/man/vgremove.8 +++ b/man/vgremove.8 @@ -8,7 +8,10 @@ VolumeGroupName [VolumeGroupName...] .SH DESCRIPTION vgremove allows you to remove one or more volume groups. The volume group(s) must not have any logical volumes allocated: -Remove them first with \fBlvremove\fP. +Remove them first with \fBlvremove\fP. If one or more physical +volumes in the volume group are lost, consider +\fBvgreduce --removemissing\fP to make the volume group +metadata consistent again. .SH OPTIONS See \fBlvm\fP for common options. .SH SEE ALSO diff --git a/tools/vgremove.c b/tools/vgremove.c index 1c5553de4..7b85e2078 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);