Hello,
On 09/09/2022 at 16:54, Johannes Schauer Marin Rodrigues wrote:
> partman-auto/cap-ram=1024
(...)
Description: for internal use; can be preseeded
Cap RAM size to specified size in MB, when calculating the swap
partition size. Defaults to 1024, meaning 1GB, and since swap is
maximum 200% of RAM in the default recipes, it results in swap
partitions to be capped at 2GB.
This description is not even correct. The maximum size is 1 GB, not 2 GB
due to the current settings in the default recipes :
min prio max
100% 512 200% linux-swap
In the current algorithm, whenever prio <= min, the increment factor is
set to 0 so the final size is capped to the min value and can never
reach the max value.
To achieve the described behaviour, prio should be > 100%.
(Also, when looking at partman-auto recipes, I spotted other possible
inconsistencies. For instance, the minimum size for / in multi_scheme
(2000) is bigger than in home_scheme (1500) which is bigger than in
atomic_scheme (800 or 900). Isn't it illogical that the minimum size
decreases when it needs to contain more stuff ?)
Maybe this helps somebody. Thanks to pham from the #debian-boot IRC channel for
this tip!
You're welcome josch !
Sorry to insist, but IMO this issue should really be worked out. I once
suggested the following simple formula :
max swap size = min(RAM size, disk space * R)
with R being a ratio between 0 and 100% to be defined.
For example with R=5%, the swap size would be limited to either the RAM
size or 5% of available disk space, whichever is lower.
Doesn't that sound reasonable for most setups, at least more than the
current formula ?