Overview
Hibernate saves the entire RAM state to disk and powers off the machine. When you power it back on, the system restores exactly where you left off.
For hibernate to work properly:
- Swap must exist
- Swap size should be >= RAM
- The kernel must know where the swap is
Debian-based distributions
Examples: Ubuntu, Linux Mint, Pop!_OS.
Check swap
swapon --showIf nothing appears, you need to create swap. Check RAM:
free -hRecommended: swap >= RAM.
Find swap UUID
blkidExample output:
/dev/sda3: UUID="xxxx-xxxx" TYPE="swap"Copy the UUID.
Configure GRUB
Edit the GRUB config:
sudo nano /etc/default/grubFind:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"Change to:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=YOUR_SWAP_UUID"Update GRUB
sudo update-grubTest hibernate
systemctl hibernateFedora
Fedora uses Dracut instead of initramfs-tools, so the process differs slightly.
Check swap
swapon --showFind swap UUID
blkidAdd the resume parameter
Edit the GRUB config:
sudo nano /etc/default/grubModify:
GRUB_CMDLINE_LINUX="resume=UUID=YOUR_SWAP_UUID"Rebuild GRUB
BIOS systems:
sudo grub2-mkconfig -o /boot/grub2/grub.cfgUEFI systems:
sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfgRebuild initramfs
sudo dracut -fTest hibernate
systemctl hibernateTroubleshooting
Check if the system supports hibernate:
cat /sys/power/stateIf disk appears, hibernate is supported. Check the log:
journalctl -bNotes
- Swap must be large enough for RAM
- A swapfile works, but a swap partition is more reliable
- Secure Boot may sometimes interfere with resume
Comments
Loading the discussion…