Hibernation (S3/S4) in Linux?

If you need help with something, this is the place to be.
Post Reply
User avatar
andreizabest
Posts: 55
Joined: Sat Dec 10, 2022 4:49 am

Hibernation (S3/S4) in Linux?

Post by andreizabest »

I have a Thinkpad L380 that I've been primarily using with Ubuntu 22.0.4.3 LTS but it does have Windows as well to dual boot. On Windows I am used to being able to put my laptop in hibernation mode, essentially turning the laptop off to save battery but being able to resume relatively quickly after turning on with all the apps that I had open. I have Secure Boot enabled and TMP2.0 (but I don't think it's doing anything in Ubuntu). In Ubuntu the "Suspend" option does save on battery life but it still slowly chews through the battery, and I don't think it makes use of the sleep states.

So I want to know if it's possible and how to enable deep sleep states like S3/S4/Hybrid in Ubuntu. I'd be preferable if it could be an extra option when I go to Power off/Log out but it will probably be fine if it's simple script I can use on the desktop. Apparently there's also Intel Rapid Start Technology but I'm not sure if my Thinkpad supports it.

Below are the supported sleep states according to windows. I couldn't find a similar command to powercfg /availablesleepstates in Linux.
Capture.PNG
User avatar
andreizabest
Posts: 55
Joined: Sat Dec 10, 2022 4:49 am

Re: Hibernation (S3/S4) in Linux?

Post by andreizabest »

It's S4 sleep I was actually looking for and that's not supported by Linux.It's related to kernel lockdown somehow.

I can't disable secure boot on my thinkpad unfortunately so it will remain this way, I think the windows installation might break if I disabled it anyway.

As a side note related to kernel lockdown
Apparently Linus was part of a heated argument at some point and refused to merge changes to the kernel that might've got this working, essentially meaning, to my knowledge, that no Linux machine is able to do S4 sleep (Hibernation) with secure boot enabled, and probably won't ever unless some major changes occur/forces act that will force them to implement the relevant changes that might tangentally fix S4 sleep under secure boot.

https://lkml.iu.edu/hypermail/linux/ker ... 01607.html
This is the part of a longass thread where Linus says at the very end "No way in hell will I merge anything like this."
It is kinda sad that this doesn't work, S4 sleep is a feature I really enjoyed, and it's useful beyond leaving a laptop over the weekend, for example from my understanding if a laptop is low on battery and is in S3 sleep (suspend to ram) it will suspend to disk before shutting off, allowing you to resume easily after plugging into power with all your work saved.
Post Reply