|
|
0b05ab |
From caec289d8220fc9a8d8b3d6e99271394f4ef83fe Mon Sep 17 00:00:00 2001
|
|
|
0b05ab |
From: Vojtech Trefny <vtrefny@redhat.com>
|
|
|
0b05ab |
Date: Wed, 27 Feb 2019 12:26:30 +0100
|
|
|
0b05ab |
Subject: [PATCH] Automatically adjust size of growable devices for new format
|
|
|
0b05ab |
|
|
|
0b05ab |
Without this kickstart 'part /home --size=1 --grow --encrypted'
|
|
|
0b05ab |
will fail because min size for LUKS is 2 MiB.
|
|
|
0b05ab |
|
|
|
0b05ab |
Resolves: rhbz#1680013
|
|
|
0b05ab |
---
|
|
|
0b05ab |
blivet/devices/storage.py | 7 ++++++-
|
|
|
0b05ab |
1 file changed, 6 insertions(+), 1 deletion(-)
|
|
|
0b05ab |
|
|
|
0b05ab |
diff --git a/blivet/devices/storage.py b/blivet/devices/storage.py
|
|
|
0b05ab |
index 904b60df..9d6001e8 100644
|
|
|
0b05ab |
--- a/blivet/devices/storage.py
|
|
|
0b05ab |
+++ b/blivet/devices/storage.py
|
|
|
0b05ab |
@@ -721,7 +721,12 @@ def _set_format(self, fmt):
|
|
|
0b05ab |
if fmt.max_size and fmt.max_size < self.size:
|
|
|
0b05ab |
raise errors.DeviceError("device is too large for new format")
|
|
|
0b05ab |
elif fmt.min_size and fmt.min_size > self.size:
|
|
|
0b05ab |
- raise errors.DeviceError("device is too small for new format")
|
|
|
0b05ab |
+ if self.growable:
|
|
|
0b05ab |
+ log.info("%s: using size %s instead of %s to accommodate "
|
|
|
0b05ab |
+ "format minimum size", self.name, fmt.min_size, self.size)
|
|
|
0b05ab |
+ self.size = fmt.min_size
|
|
|
0b05ab |
+ else:
|
|
|
0b05ab |
+ raise errors.DeviceError("device is too small for new format")
|
|
|
0b05ab |
|
|
|
0b05ab |
if self._format != fmt:
|
|
|
0b05ab |
callbacks.format_removed(device=self, fmt=self._format)
|