Suspend Then Hibernate with LUKS and LVM (A Practical Setup)

Linux power management was tricky in the early days.
Adding LUKS and LVM to the mix was a suicide combo.

Today it’s not just a possibility – it’s a baseline requirement for secure Linux setups.

The Problem

On today’s Linux computers, Suspend Then Hibernate is the best of both worlds.

  • Short breaks: fast suspend
  • Long inactivity: safe hibernate
  • Battery protected
  • Sessions preserved

Common symptoms:

  • System suspends but never hibernates
  • Resume fails after hibernation
  • Black screen on wake
  • Swap not detected

Systemd claims everything is fine (it is not).

What Suspend Then Hibernate Actually Does

Important detail first.

Suspend-then-hibernate is not magic.

It works like this:

  • System suspends to RAM
  • A timer is started
  • If the timer expires:
    • System wakes up
    • Immediately hibernates to disk
  • On next power-on:
    • System resumes from swap

This means hibernate must already work perfectly.
If hibernate is broken, suspend then hibernate will also fail.

Set Up The Basics

LVM is needed in the initramfs

If the swap is on LUKS encrypted storage:

sudo apt install --reinstall cryptsetup-initramfs lvm2
sudo update-initramfs -u -k all

Configure Resume From Hibernate

Using UUID is recommended for encrypted setups to avoid mapper name changes.

Find the swap UUID:

sudo blkid | grep swap

Edit GRUB:

sudo nano /etc/default/grub

Example:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=<swap-uuid>"

Apply:

sudo update-grub

If the swap is on LUKS:

echo RESUME=UUID=<swap-uuid> | sudo tee /etc/initramfs-tools/conf.d/resume
sudo update-initramfs -u
sudo reboot

Verify The Prerequisites

Check the swap size

Swap must be at least equal to RAM.

free -h
sudo swapon --show

If swap < RAM → hibernate will fail.

Test plain hibernate

Do not continue if this fails.

sudo systemctl hibernate

The system must power off and resume correctly.

Enable Suspend-Then-Hibernate

Edit systemd sleep configuration:

sudo nano /etc/systemd/sleep.conf

Minimal, correct configuration:

[Sleep]
AllowSuspend=yes
AllowHibernation=yes
AllowSuspendThenHibernate=yes
HibernateDelaySec=30min

Manual Test

sudo systemctl suspend-then-hibernate

Expected behavior:

  • System suspends
  • After delay → hibernates
  • Power button resumes system

In case of any issue, the debug can start here:

journalctl -b -1 | grep -i hibernate

Leave a comment