From: Vojtech Trefny <vtrefny(a)redhat.com>
For encrypted partitions, min_size depends on the LUKS device
format min_size.
---
blivet/devices/partition.py | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/blivet/devices/partition.py b/blivet/devices/partition.py
index 6487625..a5a9c1c 100644
--- a/blivet/devices/partition.py
+++ b/blivet/devices/partition.py
@@ -36,6 +36,7 @@
from .. import udev
from ..formats import DeviceFormat, get_format
from ..size import Size, MiB
+from ..devicelibs.crypto import LUKS_METADATA_SIZE
import logging
log = logging.getLogger("blivet")
@@ -826,7 +827,14 @@ def min_size(self):
min_size = self.align_target_size(max(Size("1 KiB"),
self.disk.format.alignment.grainSize))
else:
- min_size = super(PartitionDevice, self).min_size
+ if self.format.type == "luks" and self.children:
+ if self.resizable:
+ min_size = self.children[0].min_size + LUKS_METADATA_SIZE
+ else:
+ min_size = self.current_size
+
+ else:
+ min_size = self.format.min_size if self.resizable else self.current_size
if self.resizable and min_size:
# Adjust the min size as needed so that aligning the end sector
--
To view this commit on github, visit
https://github.com/rhinstaller/blivet/commit/bd3d47eaafe6f10a7720869405b8...