On Thursday, 25 April 2024 22:29:01 BST Wojciech Kuzyszyn wrote:
> Hello!
> 
> Quick question: is it possible to use hibernation (suspend to disk)
> with no initramfs?

Yes.

> 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.

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to