From 238a1e812f999fad6f98fff750cf4a086cec8495 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 8 Aug 2018 05:58:41 -0400 Subject: [PATCH] [partition] Reduce the fudge-factor for swap size - Reported by Bill Auger (I think), a 15GiB disk wouldn't hold a 8.9GiB root plus 4GiB swap -- due to 10% overprovisioning of swap, plus the 2.1GiB fudge factor. --- src/modules/partition/core/PartitionActions.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/partition/core/PartitionActions.cpp b/src/modules/partition/core/PartitionActions.cpp index 6db23c00a..68ad85cf2 100644 --- a/src/modules/partition/core/PartitionActions.cpp +++ b/src/modules/partition/core/PartitionActions.cpp @@ -181,8 +181,11 @@ doAutopartition( PartitionCoreModule* core, Device* dev, const QString& luksPass { qint64 availableSpaceB = ( dev->totalLogical() - firstFreeSector ) * dev->logicalSize(); suggestedSwapSizeB = swapSuggestion( availableSpaceB ); + // Space required by this installation is what the distro claims is needed + // (via global configuration) plus the swap size plus a fudge factor of + // 0.6GiB (this was 2.1GiB up to Calamares 3.2.2). qint64 requiredSpaceB = - GiBtoBytes( gs->value( "requiredStorageGB" ).toDouble() + 0.1 + 2.0 ) + + GiBtoBytes( gs->value( "requiredStorageGB" ).toDouble() + 0.6 ) + suggestedSwapSizeB; // If there is enough room for ESP + root + swap, create swap, otherwise don't.