Enable Hibernate

I would like to enable hibernation in manjaro gnome version.

https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Hibernation

I have a 2TB nvme…
I boot gparted from live, I resize the nvme and I create a new 150GB partition (I have 128GB RAM).

Is this correct so far? Do I need to format in ext4? Do I need to apply any flags in particular to the swap partition I will create?

Can you give me advice on how to proceed?

For Hibernation you need a Swap Partition (or a Swap File).
The contents of the RAM are written to that Swap space when the system is hibernated.
If that 128 GB RAM of yours is fully used
and you want to then hibernate the system
you need about as much Swap, but likely only half of that because the data is being written in compressed form - 150 GB are too much - but will do. Just a lot of wasted space …

Swap space doesn’t have a file system, so: no
don’t format it as ext4.

You “format” it as Swap.

It is all in that wiki you linked to.

… on wakeup from hibernation, these 150 GB need to be read back,
which will take time.
Not an issue with an NVME - but still a waste of valuable space that cannot be used for “real” things … IMO (in my opinion)

1 Like

It’s correct?
Now how do I enable hibernation, from the arch guide I had difficulty continuing.

You add the resume hook in mkinitcpio.conf,

When an initramfs with the base hook is used, which is the default, the resume hook is required in /etc/mkinitcpio.conf. Whether by label or by UUID, the swap partition is referred to with a udev device node, so the resume hook must go after the udev hook. This example was made starting from the default hook configuration:

regenerate it
mkinitcpio -P

Then you add the uuid of the swap partition as kernel parameter

Required kernel parameters
The kernel parameter resume=swap_device must be used. Any of the persistent block device naming methods can be used as swap_device. For example:
resume=UUID=4209c845-f495-4c43-8a03-5363dd433153

and since that last one was in the line GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub
you have to regenerate that too
sudo update-grub

1 Like

Add to “/etc/fstab”:

UUID=xxx                 swap          swap           defaults       0             0

Then

mkinitcpio -P
sudo update-grub
reboot

Work! Thanks!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.