mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
Improve a vgremove error message.
This commit is contained in:
parent
ccce4dc0ee
commit
c27dc4e757
@ -8,7 +8,10 @@ VolumeGroupName [VolumeGroupName...]
|
|||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
vgremove allows you to remove one or more volume groups.
|
vgremove allows you to remove one or more volume groups.
|
||||||
The volume group(s) must not have any logical volumes allocated:
|
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
|
.SH OPTIONS
|
||||||
See \fBlvm\fP for common options.
|
See \fBlvm\fP for common options.
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
|
@ -23,8 +23,11 @@ static int vgremove_single(struct cmd_context *cmd, const char *vg_name,
|
|||||||
struct pv_list *pvl;
|
struct pv_list *pvl;
|
||||||
int ret = ECMD_PROCESSED;
|
int ret = ECMD_PROCESSED;
|
||||||
|
|
||||||
if (!vg || !consistent) {
|
if (!vg || !consistent || (vg->status & PARTIAL_VG)) {
|
||||||
log_error("Volume group \"%s\" doesn't exist", vg_name);
|
log_error("Volume group \"%s\" not found or inconsistent.",
|
||||||
|
vg_name);
|
||||||
|
log_error("Consider vgreduce --removemissing if metadata "
|
||||||
|
"is inconsistent.");
|
||||||
return ECMD_FAILED;
|
return ECMD_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -33,12 +36,6 @@ static int vgremove_single(struct cmd_context *cmd, const char *vg_name,
|
|||||||
return ECMD_FAILED;
|
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) {
|
if (vg->lv_count) {
|
||||||
log_error("Volume group \"%s\" still contains %d "
|
log_error("Volume group \"%s\" still contains %d "
|
||||||
"logical volume(s)", vg_name, vg->lv_count);
|
"logical volume(s)", vg_name, vg->lv_count);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user