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

[PATCH] LVM and LUKS now align everything to 1MB boundaries. (#623458)



---
 pyanaconda/storage/devicelibs/lvm.py |    3 +++
 pyanaconda/storage/devices.py        |    4 ++--
 pyanaconda/storage/formats/lvmpv.py  |    2 +-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/pyanaconda/storage/devicelibs/lvm.py b/pyanaconda/storage/devicelibs/lvm.py
index 52fdf40..39f4c28 100644
--- a/pyanaconda/storage/devicelibs/lvm.py
+++ b/pyanaconda/storage/devicelibs/lvm.py
@@ -167,8 +167,11 @@ def lvm(args, progress=None):
         raise LVMError(ret.stderr)
 
 def pvcreate(device, progress=None):
+    # we force dataalignment=1024k since we cannot get lvm to tell us what
+    # the pe_start will be in advance
     args = ["pvcreate"] + \
             config_args + \
+            ["--dataalignment", "1024k"] + \
             [device]
 
     try:
diff --git a/pyanaconda/storage/devices.py b/pyanaconda/storage/devices.py
index 7b42d43..c5983ee 100644
--- a/pyanaconda/storage/devices.py
+++ b/pyanaconda/storage/devices.py
@@ -1659,8 +1659,8 @@ class LUKSDevice(DMCryptDevice):
     @property
     def size(self):
         if not self.exists or not self.partedDevice:
-            # the LUKS header takes up 4040 512-byte sectors w/ a 512-bit key
-            size = float(self.slave.size) - ((4040 * 2.0) / 1024)
+            # the LUKS metadata area is 2MB
+            size = float(self.slave.size) - 2.0
         else:
             size = self.partedDevice.getSize()
         return size
diff --git a/pyanaconda/storage/formats/lvmpv.py b/pyanaconda/storage/formats/lvmpv.py
index 9fe9ba3..3004bb6 100644
--- a/pyanaconda/storage/formats/lvmpv.py
+++ b/pyanaconda/storage/formats/lvmpv.py
@@ -65,7 +65,7 @@ class LVMPhysicalVolume(DeviceFormat):
         self.vgUuid = kwargs.get("vgUuid")
         # liblvm may be able to tell us this at some point, even
         # for not-yet-created devices
-        self.peStart = kwargs.get("peStart", 0.1875)    # in MB
+        self.peStart = kwargs.get("peStart", 1.0)    # in MB
 
     def __str__(self):
         s = DeviceFormat.__str__(self)
-- 
1.7.1.1


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