Ask Your Question

Revision history [back]

In Fedora 24 (and I believe it is from Fedora 22 up) the hibernate or hybrid sleep is not enabled by default. To enable it run this code as root:

#!/bin/bash
# Enable hibernation
# Using info from:
# https://psohny.wordpress.com/2015/08/13/fedora_hiber/

# Enable recovery in the /etc/default/grub
sed -i -e 's|^\(GRUB_DISABLE_RECOVERY="\)true"|\1false"|' /etc/default/grub

#Find the swapdevice
SWAPDEVICE=`grep -e '^[^#].*swap' /etc/fstab | head -n 1 | cut -d ' ' -f 1`
echo "Using SWAPDEVICE=${SWAPDEVICE} for hibernation"

#add "resume=swapdevice" to the GRUB_CMDLINE_LINUX=
sed -i -e "s|^\(GRUB_CMDLINE_LINUX=\".*\)\"|\1 resume=${SWAPDEVICE}\"|" /etc/default/grub

#Regenerate the grub config
/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg

After regenerating the grub configuration, now you need to reboot your machine

reboot

Now after reboot it will be possible to hibernate or even hybrid-sleep

systemctl hibernate -i
systemctl hybrid-sleep -i