Skip to content

Linux power management

Power adapter status

sensors | grep -iA5 bat

Suspend and Hibernate

Arch suspend and hibernate

Blank screen after suspend

Hibernate on ubuntu

Using a swapfile on encrypted rootfs

Problem: On a fresh ubuntu 20.04 install, the swap partition is too small (~1Gb) for a hibernate image. So we need to remove it and use a swapfile.

See ~/disk/swap.md on how to properly size swap.

sudo findmnt -no SOURCE,UUID -T /var/lib/swapfile

sudo apt -y install uswsusp
sudo dpkg-reconfigure -pmedium uswsusp
# Answer "Yes" to continue without swap space
# Select "/dev/disk/by-uuid/20562a02-cfa6-42e0-bb9f-5e936ea763d0" replace the UUID with the result from the previous findmnt command
# Encrypt: "No"

...

Handle lid close behaviour

http://ubuntuhandbook.org/index.php/2020/05/lid-close-behavior-ubuntu-20-04/