[PATCH] Make sure the pvs are set up before doing lvremove or vgremove.

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

 



LVM can't modify a VG without having access to its PVs, so if they
are encrypted or on an md device we need to make sure they get set
up before we try to use them.
---
 storage/devices.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index 1e67e80..33004dc 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -1663,7 +1663,8 @@ class LVMVolumeGroupDevice(DMDevice):
         if not self.exists:
             raise DeviceError("device has not been created")
 
-        self.teardown()
+        # set up the pvs since lvm needs access to them to do the vgremove
+        self.setupParents()
 
         # this sometimes fails for some reason.
         try:
@@ -1968,6 +1969,8 @@ class LVMLogicalVolumeDevice(DMDevice):
             raise DeviceError("device has not been created")
 
         self.teardown()
+        # set up the vg's pvs so lvm can remove the lv
+        self.vg.setupParents()
         lvm.lvremove(self.vg.name, self._name)
         self.exists = False
 
-- 
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