Show proper message when we cannot allocate enough space for / and swap
We try to create swap big enough for hibernation in autopartioning,
but this can be a problem on machines with a lot of RAM and small disks.
Since we shouldn't create swap not enough big for hibernation, just
let users know they should use custom partitioning in such cases.
This patch means that we don't need flexible swap suggestions, agreed?
storage/partitioning.py | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/storage/partitioning.py b/storage/partitioning.py
index b038c23..d8a5a6a 100644
@@ -1716,7 +1716,22 @@ def growLVM(storage):
if total_free < 0:
# by now we have allocated the PVs so if there isn't enough
# space in the VG we have a real problem
- raise PartitioningError("not enough space for LVM requests")
+ # if we cannot allocate enough space for / and swap, show
+ # proper error message
+ swap_plus_root = 0
+ for lv in vg.lvs:
+ if lv.format.type == "swap" or lv.format.mountpoint == "/":
+ swap_plus_root += lv.minSize
+ additional_msg = ""
+ if swap_plus_root > vg.size:
+ additional_msg = "
Cannot allocate enough space for / "
+ "and swap big enough to allow hibernation.
+ "Use custom partitioning, please."
+ raise PartitioningError("not enough space for LVM requests" +
elif not total_free:
log.debug("vg %s has no free space" % vg.name)
Anaconda-devel-list mailing list