mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Improve a vgremove error message.
This commit is contained in:
parent
ccce4dc0ee
commit
c27dc4e757
@ -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
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user