Enable Hibernate mode on Ubuntu 25.04 (Plucky Puffin): A Step-by-Step Guide


Hibernation is not enabled by-default in Ubuntu.
If you try to hibernate using “sudo systemctl hibernate”, you will run into the below error:
call to Hibernate failed: Not enough suitable swap space for hibernation available on compatible block devices and file systems
Hibernation requires a swap space at least equal to your system’s RAM.
If the swap size is less than your RAM, you’ll need to increase it.
Check current swap usage:
swapon --show
free -h
Depending on your configuration, you either might see:
A swap partition:
OR a swap file:
If you don’t have a swap partition, Create a Dedicated Swap Partition.
Creating a Dedicated Swap Partition
Make sure the swap partition is equal or more then your RAM size.
Resize an existing partition with GParted and create a Linux swap partition.
Format and enable the swap:
Identify the correct device name and use the below commands to enable the swap
In my case the partition is /dev/nvme0n1p3
sudo mkswap /dev/nvme0n1p3
sudo swapon /dev/nvme0n1p3
Find the UUID of the partition:
sudo blkid /dev/nvme0n1p3
Add to /etc/fstab
:
UUID="XXXXXX-XXXXX-XXX-XXX-XXXXXXXX" none swap sw 0 0
- Reboot and verify the new swap is active
Edit GRUB configuration:
sudo nano /etc/default/grub
- Find the line starting with
GRUB_CMDLINE_LINUX_DEFAULT
and add the resume parameter:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=your-swap-uuid"
Replace your-swap-uuid
with the UUID you noted earlier
- Update GRUB:
sudo update-grub
- Rebuild initramfs to include resume info & reboot
sudo update-initramfs -u
sudo reboot
Enable Hibernate in PolicyKit:
sudo nano /etc/polkit-1/rules.d/10-enable-hibernate.rules
- Add the following content to the config:
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.login1.hibernate" ||
action.id == "org.freedesktop.login1.hibernate-multiple-sessions" ||
action.id == "org.freedesktop.upower.hibernate" ||
action.id == "org.freedesktop.login1.handle-hibernate-key" ||
action.id == "org.freedesktop.login1.hibernate-ignore-inhibit")
{
return polkit.Result.YES;
}
});
Test Hibernation:
sudo systemctl hibernate
GUI Hibernate button:
You can also add a Hibernate button in Status menu using this gnome extension
https://extensions.gnome.org/extension/755/hibernate-status-button/
Subscribe to my newsletter
Read articles from Sumit Sur directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
