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.
Resolves: rhbz#815557
<not-in-commit-message>
This patch means that we don't need flexible swap suggestions, agreed?
</not-in-commit-message>
---
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
--- a/storage/partitioning.py
+++ b/storage/partitioning.py
@@ -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" +
+ additional_msg)
elif not total_free:
log.debug("vg %s has no free space" % vg.name)
continue
--
1.7.4.4
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list