Discussion:
[gentoo-user] Hibernation without initramfs
(too old to reply)
Wojciech Kuzyszyn
2024-04-25 21:30:01 UTC
Permalink
Hello!

Quick question: is it possible to use hibernation (suspend to disk)
with no initramfs? I don't have one and don't want to have one. So I'd
rather disable hibernate in kernel (so I won't do this by accident) or
leave it to use it happily when needed.
--
xWK
Michael
2024-04-26 08:50:01 UTC
Permalink
Post by Wojciech Kuzyszyn
Hello!
Quick question: is it possible to use hibernation (suspend to disk)
with no initramfs?
Yes.
Post by Wojciech Kuzyszyn
I don't have one and don't want to have one. So I'd
rather disable hibernate in kernel (so I won't do this by accident) or
leave it to use it happily when needed.
You have to specify a swap block device - a swap partition, or a preconfigured
swap file on an already mounted partition - in your kernel configuration, for
hibernation to work, e.g.:

[*] Hibernation (aka 'suspend to disk')
[*] Userspace snapshot device
(/dev/sdb6) Default resume partition

This swap device will be used at hibernation time to compress and store what
is running in your RAM. Since the contents of your RAM will be compressed
less space will be required than the size of your RAM.

However, if you are using RAM heavily when you try to hibernate, e.g. because
you are compiling some large package, have many memory hungry applications
open, etc., you may find hibernation fails due to lack of space. This would
be more acute if your RAM is not large enough and swap is used on a regular
basis. With large enough RAM less swap space will be used, since swap would
be virtually empty. Therefore size your swap device accordingly.
Michael
2024-04-26 09:30:01 UTC
Permalink
On Fri, 26 Apr 2024 09:40:54 +0100
Post by Michael
[*] Hibernation (aka 'suspend to disk')
[*] Userspace snapshot device
(/dev/sdb6) Default resume partition
My swap partition is /dev/nvme0n1p2 - this would work I assume, right?
Yes, it is a block device accessed via the PCIe bus.
Post by Michael
However, if you are using RAM heavily when you try to hibernate, e.g.
because you are compiling some large package, have many memory hungry
applications open, etc., you may find hibernation fails due to lack
of space. This would be more acute if your RAM is not large enough
and swap is used on a regular basis. With large enough RAM less swap
space will be used, since swap would be virtually empty. Therefore
size your swap device accordingly.
I have oldschool swap - 2x RAM.
OK, with this much space you'd have at least 2x more hibernation storage space
than you will need. :-)
Wojciech Kuzyszyn
2024-04-26 09:30:01 UTC
Permalink
On Fri, 26 Apr 2024 09:40:54 +0100
Post by Michael
[*] Hibernation (aka 'suspend to disk')
[*] Userspace snapshot device
(/dev/sdb6) Default resume partition
My swap partition is /dev/nvme0n1p2 - this would work I assume, right?
Post by Michael
However, if you are using RAM heavily when you try to hibernate, e.g.
because you are compiling some large package, have many memory hungry
applications open, etc., you may find hibernation fails due to lack
of space. This would be more acute if your RAM is not large enough
and swap is used on a regular basis. With large enough RAM less swap
space will be used, since swap would be virtually empty. Therefore
size your swap device accordingly.
I have oldschool swap - 2x RAM.
--
xWK
Loading...