Настраиваем спящий режим в Ubuntu 20.4+

статья

apt purge uswsusp # удаляем устаревший пакет cat /proc/swaps findmnt -no UUID -T /swapfile # если swap в файле -> 4a59c6a7-ca54-4e24-a362-3eac83bfe226 sudo filefrag -v /swapfile # первый physical offset -> 4974592
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=4a59c6a7-ca54-4e24-a362-3eac83bfe226 resume_offset=4974592"

sudo update-grub

RESUME=UUID=4a59c6a7-ca54-4e24-a362-3eac83bfe226 resume_offset=4974592

sudo update-initramfs -c -k all

Test:

sudo systemctl hibernate
systemctl status systemd-hibernate.service

[Enable hibernate in upower] Identity=unix-user:* Action=org.freedesktop.upower.hibernate ResultActive=yes [Enable hibernate in logind] Identity=unix-user:* Action=org.freedesktop.login1.hibernate;org.freedesktop.login1.handle-hibernate-key;org.freedesktop.login1;org.freedesktop.login1.hibernate-multiple-sessions;org.freedesktop.login1.hibernate-ignore-inhibit ResultActive=yes