[PATCH] storage-branch vgreduce before vgremove.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey list.  This patch is needed to ensure that vgremove succeeds.

regards.
-- 
Joel Andres Granados
Brno, Czech Republic, Red Hat.
commit 87375b2caf5557a3002e65ead326bb9fca3aefe6
Author: Joel Granados Moreno <jgranado@xxxxxxxxxx>
Date:   Fri Feb 27 16:36:39 2009 +0100

    Do a vgreduce before the vgremove.
    
    This takes care of any lingering metadata that might be present in the
    PVs of the VG to be removed.

diff --git a/storage/devicelibs/lvm.py b/storage/devicelibs/lvm.py
index cd39707..afb7256 100644
--- a/storage/devicelibs/lvm.py
+++ b/storage/devicelibs/lvm.py
@@ -181,6 +181,16 @@ def vgcreate(vg_name, pvs, pe_size):
         raise LVMError("vgcreate failed for %s" % vg_name)
 
 def vgremove(vg_name):
+    rc = iutil.execWithRedirect("lvm", ["vgreduce",
+                                        "--removemissing",
+                                        "--force",
+                                        vg_name] ,
+                                stdout = "/dev/tty5",
+                                stderr = "/dev/tty5",
+                                searchPath = 1)
+    if rc:
+        raise LVMError("vgreduce failed %s" % vg_name)
+
     rc = iutil.execWithRedirect("lvm", ["vgremove", vg_name],
                                 stdout = "/dev/tty5",
                                 stderr = "/dev/tty5",
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux