Enable hibernation on Fedora Linux

Published on Author admin

Enable hibernation

To enable hibernation (suspend to disk) on Fedora Linux follow below steps:

Get path to your current SWAP partition:

sudo blkid | grep swap

Edit /etc/default/grub file and put resume= parameter at the end of line containing GRUB_CMDLINE_LINUX string.
Assuming that SWAP partition path is located at /dev/mapper/linux_vg-swap, the resume= parameter should look like this:

resume=/dev/mapper/linux_vg-swap

Next thing is to rebuild GRUB2 config file.
For BIOS computers:

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

For UEFI computers:

sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

Reboot the system and verify whether new resume= parameter is visible in current kernel command line:

cat /proc/cmdline

To hibernate use following command:

sudo systemctl hibernate

 

Enable shutdown action after hibernate

By default ACPI platform is in S4 state (suspend-to-disk, system sleep platform-provided method) after suspending to disk:

cat /sys/power/disk
[platform] shutdown reboot suspend test_resume

To enforce full shutdown action, make ACPI platform to enter S5 (soft off) instead of S4 (suspend-to-disk) state, put the following config inside /etc/systemd/sleep.conf file:

[Sleep]
HibernateMode=shutdown

Reload systemd config files:

systemctl daemon-reload

You can try to hibernate, after hibernating computer should fully shutdown.

Verify, that current action after hibernate is "shutdown":

cat /sys/power/disk
platform [shutdown] reboot suspend test_resume

You can find more details at:

https://www.kernel.org/doc/Documentation/power/states.txt

https://www.kernel.org/doc/Documentation/power/interface.txt