#1088225 debian-installer: automatic partitioning does not allow for hibernation

Package:
debian-installer
Source:
debian-installer
Description:
Debian Installer documentation
Submitter:
allan grossman
Date:
2024-11-26 20:24:01 UTC
Severity:
normal
Tags:
#1088225#5
Date:
2024-11-25 12:33:31 UTC
From:
To:
Dear Maintainer,

   * What led up to the situation?

     Installing Debian using automatic partitioning

   * What exactly did you do (or not do) that was effective (or
     ineffective)?

     Used default automatic partitioning when installing Debian

   * What was the outcome of this action?

     Resulting swap space is insufficient to support hibernation

   * What outcome did you expect instead?

     I expected for d-i automatic partitioning to reserve enough swap space
     to support hibernation.  Kernel documentation at
https://docs.kernel.org/admin-guide/pm/sleep-states.html#hibernation
      suggests that default hibernation image size is 2/5 of installed RAM
      so most users installing Debian using automatic partitioning will not
      be able to hibernate their machine.

#1088225#10
Date:
2024-11-25 13:56:05 UTC
From:
To:
Hi,

Am 25. November 2024 13:33:31 MEZ schrieb allan grossman <wizard10000@gmail.com>:

Which installation did you use?
Which URL, from which date?

Could you please sent us the installer log files, you can find them in
/var/log/installer on the installed system.


Holger

#1088225#15
Date:
2024-11-25 14:44:32 UTC
From:
To:
Am 25. November 2024 14:56:05 MEZ schrieb Holger Wansing <hwansing@mailbox.org>:

Which installation image

#1088225#20
Date:
2024-11-25 15:17:40 UTC
From:
To:
It's been probably three months ago, I used the default netinstall
image and upgraded it to Unstable.

#1088225#25
Date:
2024-11-25 16:13:46 UTC
From:
To:
Hi Allan

Am 25. November 2024 16:17:40 MEZ schrieb allan <wizard10000@gmail.com>:
there have been changings to fix exactly this issue (amongst others)
and the package with these changings has been uploaded on
Oct 08, 2024.

So, could you try again with a recent image?
Thanks


Holger

#1088225#30
Date:
2024-11-25 16:25:21 UTC
From:
To:
I'm afraid those logs are no longer available.
#1088225#35
Date:
2024-11-26 13:15:22 UTC
From:
To:
Hi Allan,

Am 25. November 2024 17:25:21 MEZ schrieb allan <wizard10000@gmail.com>:

That's no problem.
We need you to do another test with a recent image anyway (as
I already wrote in another mail).


Holger

#1088225#40
Date:
2024-11-26 14:18:22 UTC
From:
To:
I'm not able to install on another machine but I did include a
screenshot of the default "Guided Partitioning - Use Entire Disk"
before actually making changes to a disk.

I just did this ten minutes ago using the current netinstall image and
as you can see from the attachment d-i wants to create a 1GB swap
partition.

#1088225#45
Date:
2024-11-26 15:40:29 UTC
From:
To:
Hi,

allan <wizard10000@gmail.com> wrote (Tue, 26 Nov 2024 08:18:22 -0600):

However:
20G is a rather small disk these days for a workstation with a graphical
deskop.
For example, when I test it with a 35G harddrive, I get 2G of swap partition.

How much RAM has your machine?


Holger

#1088225#50
Date:
2024-11-26 15:56:43 UTC
From:
To:
I did it on QEMU/KVM and allocated 8GB.  Still, if default hibernation
image is up to 2/5 of installed RAM a 1GB swap partition could be
insufficient.

I think the algorithm that allocates swap space might need a look.  I
can't prove it because the installation no longer exists but I saw
that same 1GB swap partition about three months ago when installing to
a 240GB external drive on a machine with 8GB RAM.

#1088225#55
Date:
2024-11-26 16:06:35 UTC
From:
To:
This screenshot is another VM install I just started - I allocated
12GB RAM and 100GB disk - note swap is still set at 1GB -

thanks  :)

#1088225#60
Date:
2024-11-26 18:22:39 UTC
From:
To:
Hi,

allan <wizard10000@gmail.com> wrote (Tue, 26 Nov 2024 09:56:43 -0600):

That rule of thumb is new to me.
I know the rule, that swap should be as big as RAM.
And this was used, to define the new logic for calculation of partitions.

Testing this case, I get 8,6 GB of swap.
So above rule is followed.
And hibernation should work.


Holger

#1088225#65
Date:
2024-11-26 18:27:20 UTC
From:
To:
Reference - https://docs.kernel.org/admin-guide/pm/sleep-states.html#hibernation

Gonna quote the relevant part here but you're welcome to check for yourself  :)

image_size

This file controls the size of hibernation images.

It can be written a string representing a non-negative integer that
will be used as a best-effort upper limit of the image size, in bytes.
The hibernation core will do its best to ensure that the image size
will not exceed that number, but if that turns out to be impossible to
achieve, a hibernation image will still be created and its size will
be as small as possible. In particular, writing ‘0’ to this file
causes the size of hibernation images to be minimum.

Reading from it returns the current image size limit, which is set to
around 2/5 of the available RAM size by default.

#1088225#70
Date:
2024-11-26 18:28:45 UTC
From:
To:
Hi,

allan <wizard10000@gmail.com> wrote (Tue, 26 Nov 2024 10:06:35 -0600):

I guess you used the old installation image from 3 months ago for this test...

Holger

#1088225#75
Date:
2024-11-26 18:32:16 UTC
From:
To:
I'm afraid not - I downloaded it from debian.org's homepage this morning..
#1088225#80
Date:
2024-11-26 18:50:10 UTC
From:
To:
allan <wizard10000@gmail.com> wrote (Tue, 26 Nov 2024 12:32:16 -0600):

So this bug would need to be tagged 'unreproducible' since it looks completely
different here: 5,5GB of swap on a QEMU VM with 12GB of RAM and 100GB harddrive.

#1088225#87
Date:
2024-11-26 18:50:18 UTC
From:
To:
Please give the full URL to what you downloaded instead of letting other
people *guess* what you DL-ed.

#1088225#97
Date:
2024-11-26 19:27:56 UTC
From:
To:
Excellent, that clears up the confusion.
There have been updates in (Unstable and) Testing which is what Holger
was referring to. But ofc don't changes aren't available in Stable.

#1088225#102
Date:
2024-11-26 19:44:46 UTC
From:
To:
Ah - that makes sense.  I'm just glad it got fixed before Trixie's release  :)

Thanks to you and to Holger!

#1088225#107
Date:
2024-11-26 20:21:07 UTC
From:
To:
This is a stable image. Please download a recent daily or weekly build
testing/sid image from <https://cdimage.debian.org/cdimage/>

My comment on some earlier posts:

The new swap size by testing/sid installer is the lower of approximately
5% of available disk size and 100% of RAM size. So it is still limited
to 1GB on a 20GB disk, and 8GB on a 160GB disk.
(...)

IIRC, the hibernation image size cannot exceed half of the RAM size (it
must be able to contain a copy of the other half and still fit into memory).

Note that the swap area does not contain only the hibernation image. It
also contains swapped out data, which were swapped out as part of
regular virtual memory operation or to reduce the size of the
hibernation image.

There is no rule to calculate the swap size for hibernation, it depends
on the use case (memory usage and how much swap is used before the
system goes to hibernation).