[PATCH 5/5] Don't fail to commit partitions due to active lvm/md.

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

 



If we get a failure to commit a partitioning change to disk, the first
thing to do is try shutting down all devices: In the case of lvm-on-md
we implicitly activate the md device in order to wipe an lv that we're
about to destroy. Subsequent attempts to commit to a disk containing any
of the md device's members will fail because the md is still active.

---
 storage/devicetree.py |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/storage/devicetree.py b/storage/devicetree.py
index 8fd628c..b32d4ef 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -719,7 +719,14 @@ class DeviceTree(object):
         for action in self._actions:
             log.info("executing action: %s" % action)
             if not dryRun:
-                action.execute(intf=self.intf)
+                try:
+                    action.execute(intf=self.intf)
+                except DiskLabelCommitError:
+                    # it's likely that a previous format destroy action
+                    # triggered setup of an lvm or md device.
+                    self.teardownAll()
+                    action.execute(intf=self.intf)
+
                 udev_settle(timeout=10)
                 for device in self._devices:
                     # make sure we catch any renumbering parted does
-- 
1.6.0.6

_______________________________________________
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