Desktop/tweaks/hibernation.md

870 B

Enable hibernation

Run this command to get required swap size in KiB and then create the swap partition.

echo $(($(cat /proc/meminfo | awk '/MemTotal/ {print $2}')+5000))

If you dont need it, disable Fedora's ZRAM.

sudo dnf remove zram-generator-defaults

Swap

Disable all used swaps.

sudo swapoff -a

Get swap partition UUID, add it to the fstab and enable swap.

sudo blkid /dev/sda3
echo 'UUID=56a260a8-5a66-40db-bcb6-701f72a890bb none swap sw 0 0' | sudo tee -a /etc/fstab
sudo swapon -a

Grub

Get swap partition UUID and physical offset and edit GRUB's config in /etc/default/grub.

Add resume=UUID=56a260a8-5a66-40db-bcb6-701f72a890bb to GRUB_CMDLINE_LINUX_DEFAULT.

Regenerate grub config and hibernation should be possible.

sudo grub2-mkconfig -o "$(readlink -e /etc/grub2.conf)"