[PATCH] RHEL 5.3 #469700 - wipe old lvm metadata

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

 



Hi,

this patch is a port of bugfix #257161 from rhel4 to fix bug #469700 (and most probably its
dupe #468431, the issue was also probably met in #466902).

Radek
diff --git a/fsset.py b/fsset.py
index 5b3b4e8..254e19f 100644
--- a/fsset.py
+++ b/fsset.py
@@ -2605,6 +2605,26 @@ class VolumeGroupDevice(Device):
 
         if not self.isSetup:
             # rescan now that we've recreated pvs.  ugh.
+            lvm.writeForceConf()            
+            lvm.vgscan()
+
+            for (vg, lv, size, lvorigin) in lvm.lvlist():
+                if vg == self.name:
+                    log.info("removing obsolete LV %s/%s" % (vg, lv))
+                    try:
+                        lvm.lvremove(lv, vg)
+                    except SystemError:
+                        pass
+
+            for (vg, size, pesize) in lvm.vglist():
+                if vg == self.name:
+                    log.info("removing obsolete VG %s" % (vg,))
+                    try:
+                        lvm.vgremove(self.name)
+                    except SystemError:
+                        pass
+
+            # rescan now that we've tried to nuke obsolete vgs.  woo.
             lvm.writeForceConf()
             lvm.vgscan()
 
_______________________________________________
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