Hibernate is available, but it does not work by default on Fedora 24 due to a missing parameter.
When hibernating, the system state is saved in an image on disk, which must be loaded and restored the next time the system is booted.
In order for hibernate to work properly, the system needs to know where its state (memory) is saved on disk. Even if it's saved in a swap partition that is currently being used (and that is large enough to hold the contents of the RAM) - if it does not know that there might be a saved state image on that swap partition when booting, it would just boot normally, not restoring the state, which would be just like a system crash (state lost).
When booting, the Linux kernel must be provided with a resume
parameter with the location of the swap partition that would contain a state image. Unfortunately, the Fedora installer does not seem to configure this parameter, which is why hibernate does not work by default. All you need to do to fix it is add this parameter to the boot configuration, so that the system will look for a saved state when turned on.
Find out what you need to add:
It's resume=/path/to/swap
, where /path/to/swap
must be replaced with your swap partition (that, again, should be large enough to hold the contents of the RAM). Run the following command to find out where your swap partition is: swapon -s
In the following example, the path would be /dev/sda2
(parameter: resume=/dev/sda2
):
# swapon -s
Filename Type Size Used Priority
/dev/sda2 partition 16777216 1004 -1
Note that this gives you the current device path of the mounted swap partition. If your swap partition is on top of another filesystem layer, e.g., if it's encrypted (luks/dmcrypt), use the path in your fstab, which might differ from the above output:
# grep swap /etc/fstab
/dev/mapper/luks-123 swap swap defaults,x-systemd.device-timeout=0 0 0
In this case, you might end up with something like: resume=/dev/mapper/luks-123
Add this parameter to the boot config template:
As root, edit /etc/default/grub
(e.g., sudo vi ...
or sudo gedit /etc/default/grub
), find the line that starts with GRUB_CMDLINE_LINUX=
and append the resume=...
parameter at the end of the quote (before "
).
Then, update the boot configuration based on this template, so that the parameter will be used from now on when the system is booting. The following command writes the boot configuration for BIOS systems. EFI systems have a different config file (see below). If you're not sure, make sure the file exists.
# grub2-mkconfig -o /boot/grub2/grub.cfg
EFI systems may use /boot/efi/EFI/fedora/grub.cfg
. If your system is using that file, use:
# grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
This is the command you mentioned in your question, but as long as you don't update the ... (more)