5

I've been trying to enable hibernation functionality to my installation of Ubuntu 24.04 LTS and am failing miserably!

I'm running it on an Intel Core i7-7700K with 16GB of RAM and SSD. I'm using a 20GB SWAP partition at the end of my storage unit.

I tried to set my system to hibernate by using sudo systemctl hibernate, but it didn't work and got

Call to Hibernate failed: Sleep verb 'hibernate' is not configured or configuration is not supported by kernel

Then I tried to enable it in the kernel and recompile it, but also didn't work. The compilation broke for a different reason altogether, and I can't figure out why.

Can someone help me out here? Any help would be greatly appreciated!

2 Answers2

6

This:

Call to Hibernate failed: Sleep verb 'hibernate' is not configured or configuration is not supported by kernel

you get when you have secure boot enabled in bios. Disable it as those 2 do not mix.

Rinzwind
  • 309,379
0

I managed to make hibernation work with a swap partition:

  1. (optional) Before installing Ubuntu, from your live USB go to GParted, delete any already partition created (if any) in the disk you will use for installing the OS.
  2. Using all the free space now, Create in GParted a linux-swap partition with the right size. For Ubuntu is a little bit more than your RAM size (Google this). I have 32 GB of RAM so I have a 40gp swap file. Assign all the labels/options for swap.
  3. Proceed with the installation. In this step you can freely choose to encrypt Ubuntu (LVM + Encryption option and then go back and choose the first option for Installing Ubuntu to make this work) and it will still work. The installer won't touch your new partition
  4. Once installed, boot into Ubuntu
  5. Check with sudo swapon -s and free -m if the swap image file is being used (NOT the partition). This file was probably created automatically
  6. Delete the swap file image sudo swapoff /swap.img and sudo rm /swap.img
  7. Reboot
  8. Verify again with the previous commands if swap exists. It shouldn't
  9. Enable the swap partition now sudo mkswap /dev/xxxxxx and copy the UUID generated in the output (e.g. UUID=xxx-xxx-xxxx-xxx)
  10. Paste the UUID in /etc/fstab (sudo) and comment the previous swap file line (the last line is probably going to be pointing to the swap image created by Ubuntu before). Example: UUID=xxxx-xxx-xxx-xxx none swap sw 0 0
  11. Do the same in /etc/default/grub (sudo): GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=xxxxx-xxxxx-xxxx-xxxx"
  12. Reboot
  13. Verify with sudo swapon -s and free -m if swap is configured. Another optional check, run cat /proc/cmdline and check if the variable changed in /etc/default/grub is in the output.
  14. Test hibernation sudo systemctl hibernate

Let me know if something doesn't work

Runsis
  • 203