Lesson 2 of 19 ↓
- 1.Fedora + Distrobox + Arch + AUR Setup Guide
- 2.Enabling Hibernate on Linux
- 3.A Practical Git Workflow
- 4.Useful Linux Commands & Tips
- 5.Mirroring Your Android Screen with Scrcpy
- 6.Downloading Media with Yt-dlp
- 7.Consistent C/c++ Style with Clang-format
- 8.Auto-mounting Drives at Boot
- 9.Customizing Grub
- 10.Linux Swap Files Explained
- 11.Zram: Compressed Swap in Ram
- 12.Custom App Launch Behavior Via .desktop Files
- 13.Custom Mime Icons in Gnome
- 14.Fixing Missing Dock Icons (startupwmclass)
- 15.Installing Questasim for Hdl Simulation
- 16.Building Python 2 From Source
- 17.Auto-Starting WhatsApp and Telegram (Minimized or Tray)
- 18.Custom Neovim Configuration Guide
- 19.Running Windows Applications on Linux Seamlessly with WinBoat (Docker)
2 min read
Enabling Hibernate on Linux
Hibernate saves the entire contents of RAM to disk and powers the machine off completely; powering back on restores the session exactly where it was left, with no battery drain in between (unlike suspend-to-RAM). For it to work, three things need to be true: swap must exist, swap must be at least as large as RAM, and the kernel needs to be told where to find it at boot. The exact steps differ slightly between Debian-based distros and Fedora.
Debian-based Distributions (ubuntu, Mint, Pop!_os)
Check swap and RAM:
swapon --show
free -hIf swapon --show prints nothing, swap needs to be created first — see the swap-file guide.
Find the swap UUID:
blkid/dev/sda3: UUID="xxxx-xxxx" TYPE="swap"Configure GRUB to tell the kernel where to resume from:
sudo nano /etc/default/grubChange:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"to:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=YOUR_SWAP_UUID"Apply and test:
sudo update-grub
systemctl hibernateFedora
Fedora uses Dracut instead of initramfs-tools, so rebuilding the initramfs is a separate, explicit step.
swapon --show
blkidEdit GRUB:
sudo nano /etc/default/grubGRUB_CMDLINE_LINUX="resume=UUID=YOUR_SWAP_UUID"Rebuild the GRUB config — the path differs between BIOS and UEFI systems:
# BIOS
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
# UEFI
sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfgRebuild the initramfs so Dracut knows about the resume device:
sudo dracut -fTest:
systemctl hibernateTroubleshooting
Check whether the kernel reports hibernate support at all:
cat /sys/power/stateIf disk appears in the output, hibernate is supported. If it fails to resume, check the boot log:
journalctl -bNote
- Swap must be large enough to hold the full RAM contents — undersized swap is the most common cause of a failed resume.
- A swap file works, but a dedicated swap partition tends to be more reliable for resume-from-hibernate.
- Secure Boot can occasionally interfere with the resume process; if hibernate silently fails to resume, that's worth ruling out.
Comments
Loading the discussion…