Ubuntu doesn’t enable hibernate by default because it “might not work reliably.” But when it does work, it’s magic - full system state saved to disk, zero battery drain, instant resume with all your windows exactly where you left them.
Prerequisites
You need a swap partition or swap file at least as large as your RAM.
| |
If you don’t have enough swap, create a larger swap file first.
Test if hibernate works
Before configuring, test if your hardware supports it:
| |
If your system hibernates and resumes successfully with all your programs intact, you’re good to go. If not, your hardware might not support it reliably.
Enable hibernate
1. Find your swap UUID and offset
| |
If using a swap file (not partition), also get the offset:
| |
2. Update GRUB configuration
Edit GRUB config:
| |
Find the line starting with GRUB_CMDLINE_LINUX_DEFAULT and add resume parameters:
For swap partition:
| |
For swap file:
| |
Replace:
your-swap-uuidwith the UUID from step 1your-root-uuidwith your root partition UUID (runsudo findmnt -no UUID /)your-offsetwith the offset number from step 1
Save and update GRUB:
| |
3. Update initramfs
Edit resume configuration:
| |
Add this line:
For swap partition:
| |
For swap file:
| |
Update initramfs:
| |
4. Enable hibernate in systemd
Test if systemd hibernate works:
| |
5. Add hibernate to power menu (GNOME)
Install extension or use this workaround:
| |
Add:
| |
Reboot for changes to take effect:
| |
Quick test commands
| |
Troubleshooting
Hibernate fails
Check logs:
| |
Resume fails (boots normally instead of resuming)
Double-check your resume UUID and offset:
| |
All three should have matching UUID and offset values.
Hibernate option still not in GUI
GNOME hides hibernate by default. Use this extension:
Or hibernate from terminal/script.
Create hibernate shortcut
Add to your keyboard shortcuts:
| |
Pro tip: Once configured, sudo systemctl hibernate is faster than suspend for long-term laptop storage. Your battery won’t drain at all, and you resume exactly where you left off - even weeks later. Perfect for travel.