[PATCH] LVM VG size is not same as the device where PV is. (#480793)

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

 



This takes care of the corner case in which the clamping for the vgsize
does not give us enough space for the PV metadata.
Also revert the previous attempt to fix this in autopart.py.  It broke
everything else and is not a good idea.
---
 autopart.py     |    2 +-
 partRequests.py |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/autopart.py b/autopart.py
index 2938d9b..2c6f5e8 100644
--- a/autopart.py
+++ b/autopart.py
@@ -534,7 +534,7 @@ def growLogicalVolumes(diskset, requests):
 		    log("considering %s, start size = %s",req.logicalVolumeName, req.getStartSize())
 		    
 		# get remaining free space
-		vgfree = lvm.getVGFreeSpace(vgreq, requests, diskset) - (2*vgreq.pesize)
+		vgfree = lvm.getVGFreeSpace(vgreq, requests, diskset)
 
 #		print "vgfree = ", vgfree
                 if DEBUG_LVM_GROW:
diff --git a/partRequests.py b/partRequests.py
index 26b77f0..f907525 100644
--- a/partRequests.py
+++ b/partRequests.py
@@ -762,6 +762,8 @@ class VolumeGroupRequestSpec(RequestSpec):
                 size = pvreq.getActualSize(partitions, diskset)
                 #log("size for pv %s is %s" % (pvid, size))
                 clamped = lvm.clampPVSize(size, self.pesize)
+                if clamped == long(size):
+                    clamped = clamped - (2*self.pesize)
                 log("  got pv.size of %s, clamped to %s" % (size,clamped))
                 #log("  clamped size is %s" % (size,))
                 totalspace = totalspace + clamped
-- 
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