summaryrefslogtreecommitdiffstats
path: root/tools/vgreduce.c
diff options
context:
space:
mode:
authorPetr Rockai <prockai@redhat.com>2009-06-15 14:47:39 +0000
committerPetr Rockai <prockai@redhat.com>2009-06-15 14:47:39 +0000
commit1f164ad9d060c43b21c34668664a504671fd7329 (patch)
tree9ac1f8d25fca75d23e2a8108cde05e152d698b5c /tools/vgreduce.c
parent1bf740434accf20e66383b1ed842bd465ccfb2f5 (diff)
downloadlvm2-1f164ad9d060c43b21c34668664a504671fd7329.tar.gz
lvm2-1f164ad9d060c43b21c34668664a504671fd7329.tar.xz
lvm2-1f164ad9d060c43b21c34668664a504671fd7329.zip
- Ignore suspended devices during repair (Milan).
- Call vgreduce --removemissing (without --force) automatically to clean up bad PVs (Milan).
Diffstat (limited to 'tools/vgreduce.c')
-rw-r--r--tools/vgreduce.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/vgreduce.c b/tools/vgreduce.c
index 014d3379..1428a991 100644
--- a/tools/vgreduce.c
+++ b/tools/vgreduce.c
@@ -466,6 +466,7 @@ int vgreduce(struct cmd_context *cmd, int argc, char **argv)
int consistent = 1;
int fixed = 1;
int repairing = arg_count(cmd, removemissing_ARG);
+ int saved_ignore_suspended_devices = ignore_suspended_devices();
if (!argc && !repairing) {
log_error("Please give volume group name and "
@@ -515,6 +516,9 @@ int vgreduce(struct cmd_context *cmd, int argc, char **argv)
return ECMD_FAILED;
}
+ if (repairing)
+ init_ignore_suspended_devices(1);
+
if ((!(vg = vg_read_internal(cmd, vg_name, NULL, &consistent)) || !consistent)
&& !repairing) {
log_error("Volume group \"%s\" doesn't exist", vg_name);
@@ -574,6 +578,7 @@ int vgreduce(struct cmd_context *cmd, int argc, char **argv)
}
out:
+ init_ignore_suspended_devices(saved_ignore_suspended_devices);
unlock_and_release_vg(cmd, vg, vg_name);
return ret;