Thanks, @megavolt, for the guide, as this helped me get started.
Here are a few observations, which are most likely relevant in time, i.e., 6.1.12-1-MANJARO and systemd 252 (252.5-1-manjaro).
- Steps to create swap file on BTRFS work flawlessly
-
echo -e "GRUB_CMDLINE_LINUX_DEFAULT+=\" resume=UUID=$swp_uuid resume_offset=$swp_offset \"" | sudo tee -a /etc/default/grub
appends the changes to the end of /etc/default/grub
-
echo -e "HOOKS+=( resume )" | sudo tee -a /etc/mkinitcpio.conf
appends the changes to the end of /etc/
.conf
@zilexa, the additional changes you allude to are mostly unnecessary now. Except for HandlePowerKey=hibernate
, the other settings are default values, and compiled into the kernel. Likewise, the symbolic link breaks hibernation. Indeed, it is my understanding that systemd 252 introduced some changes to power management*, and this will change again in 253.
The only addition I made was to add the Hibernate Status Button extension to GNOME.
In summary, systemctl suspend
, closing the lid, or using the updated power menu will enter deep sleep. systemctl hibernate
suspends to disk immediately, as does the hibernate menu option.
Finally, systemctl suspend-then-hibernate
will write data to disk and NVM, and put the laptop to sleep. I also observe that with very low battery, GNOME will initiate suspend, but this action implements suspend-then-hibernate. I’ve not had the patience or time to fully test, but I understand that a timer (defined by HibernateDelaySec=120min
) will check power, and then hibernate.
If power is lost beforehand, the state is already saved to disk. This seems to work when I initiate shutdown using the power button.
I trust this information is useful.
*systemd-sleep.conf