EndeavourOS is an Arch-based Linux distro, so the technique for enabling hibernation for an Arch-based distro should work out of the box. That was true until the new ISO released this December, “Cassini”, where they switched from “mkinitcpio” to “dracut”.
Now, a few things must be adapted to make hibernation work in EndeavourOS, and the automatic tool described in my previous post can no longer be used. However, don’t worry; it’s not hard to enable hibernation. In this post, I’ll describe the steps to enable it.
IMPORTANT: my instructions assume that you have a SWAP partition; for a SWAP file, you’ll have to adapt a few things, but I can’t help since I never use SWAP files.
First, you need to have a swap partition already set up. For example, in /etc/fstab, you should have something like
1 2 |
# swap was on /dev/<your swap partition> during installation UUID=<the UUID of your swap partition> none swap sw 0 0 |
The UUID is essential, and you should take note of it.
Then, we must tell “dracut” about hibernation so that it generates initramfs accordingly. It is enough to create the file “/etc/dracut.conf.d/resume.conf” with this line:
1 |
add_dracutmodules+=" resume " |
By the way, a quick way to do that is by running this command:
1 2 3 |
cat <<-EOF | sudo tee /etc/dracut.conf.d/resume.conf add_dracutmodules+=" resume " EOF |
Then, we regenerate initramfs:
1 |
sudo dracut-rebuild |
Now, edit your /etc/default/grub and specify resume in GRUB_CMDLINE_LINUX_DEFAULT, with the UUID of your swap partition. So it should be something like (remember that <UUID of your swap partition> must be replaced with the UUID; the “…” refer to existing options):
1 |
GRUB_CMDLINE_LINUX_DEFAULT="... resume=UUID=<UUID of your swap partition>" |
Save the file and update the grub configuration:
1 |
sudo grub-mkconfig -o /boot/grub/grub.cfg |
Now, reboot and hibernate should work. You can try that with the following:
1 |
sudo systemctl hibernate |
You may also want to refer to the older post enabling hibernation in Linux, particularly in Ubuntu, for other mechanisms related to hibernation, like suspend and then hibernate.