20

Enabling Hibernation in EndeavourOS (with dracut)

 1 year ago
source link: https://www.lorenzobettini.it/2022/12/enabling-hibernation-in-endeavouros/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Enabling Hibernation in EndeavourOS (with dracut)

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

# 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:

add_dracutmodules+=" resume "

By the way, a quick way to do that is by running this command:

cat <<-EOF | sudo tee /etc/dracut.conf.d/resume.conf
add_dracutmodules+=" resume "

Then, we regenerate initramfs:

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):

GRUB_CMDLINE_LINUX_DEFAULT="... resume=UUID=<UUID of your swap partition>"

Save the file and update the grub configuration:

sudo grub-mkconfig -o /boot/grub/grub.cfg

Now, reboot and hibernate should work. You can try that with the following:

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.

Like this:

Loading...

Related


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK