For support staff, and for hardware & OS vendors, dealing with customers complaining about hibernation or S3 sleep not working those states were so infuriating and definitely NOT a solved problem.
Example failure modes: — Doesn't wake when told. — Immediately wakes instead of staying in low power state. — Performs a cold boot when trying to wake. — OS disables desired state with no explanation. — OS disables desired state which has worked perfectly on that machine for month/years, and OS claims it has been disabled because it is not compatible.
(I admit I haven't used systems with broken hibernates, or at least not any where a little it of troubleshooting could get it working, so that may skew my perception of it.)
Problem is that hibernation is slooow so people don't like to use it
It's still possible to assign "hibernate" as the action taken in response to various power-related actions such as closing the lid or pressing the power button. This makes no sense; I'm not sure what's going on.
System -> Power & sleep -> Additional power settings -> Choose what the power buttons do -> Change settings that are currently unavailable -> Check Hibernate.
And then get lucky that your laptop wakes up again (mine dies 1 out of 10 times)
Edit: sorry, can't read.
"Turn on fast startup (recommended)" is checked, and that option is also disabled and can't be unchecked, despite obviously being undesirable.
My drive can write with up to 3gb/s. I only have 32 gb of ram, so the process should take at most 10s. Generally less, as a lot is usually free.
My 9-year-old SATA SSD does better than that.
i haven't encountered anyone in years that didn't have at least one in their pc/laptop, but if you dont: i strongly suggest you buy one. because writing 30 Gbyte sequentially generally does takes about 10 seconds.
not sure how that would in any way impact a hibernate routine which would very rarely have to store more then 64gb though.
I guess most people have 16 GiB RAM or less though. I'm not sure why an ~10 second wait is too long given that the user intentionally selected hibernate instead of sleep.
It isn't. It can add just some seconds (probably less than 5 on fast SSDs, even less if you don't have too much RAM). If people can't wait this little they need to have their lives / jobs / mental health fixed rather than add more orders of complexity (with according increase in problems) into the computers.
On my work laptop (modern HP Elitebook), sleep doesn't work at all (laptop just turns on again after going to sleep), so I'm using hibernate exclusively. Waking up from hibernate takes longer than one minute.
On the other hand, my private laptop (Huawei Matebook) wakes up from sleep in less than 10 seconds.
For secure boot I would guess you could have the EFI partition signed/validated with the TPM.
In my case, I use SecureBoot to check the boot image's signature (contains the kernel + initrd + boot params). Then it starts everything from an LVM that lives on top of LUKS. I always have to type in the password (never bothered to get the TPM working), but I don't see why the TPM wouldn't be able to do it.
From the system boot point of view, it just starts an OS. The OS will then proceed to load some data in RAM. It's its business whether this is "fresh" data for a new boot, or "old" data from the last boot.
As for security, the hibernation image is at risk unless you use full disk encryption. But then (last time I checked) so is the typical Linux distro because ultimately you (the end user) have complete control over the OS. That means that at some point the kernel has to load and run privileged code that was never signed by some central authority. The only alternative to this would be sending all drivers to be signed by someone else, even those you built yourself from source.
tl;dr You can in fact use hibernation if you set it up, even with secure boot. Doing so is not a security issue. Lack of full disk encryption is always a security issue if physical access is an attack vector you are concerned about.
Now that batteries are decent and S3 on Linux is good, I don’t bother with anything else. I reboot/power off my machines on a regular basis to make sure the things I need persisted are, in fact, persisted and everything will be brought up again.
So I was quite surprised to find resume= pointing to my swap partition in my /proc/cmdline after a default install.
I have Arch configured to hibernate on lid close, and it's only about 8 seconds from lid open to a working login.
It also means I don't lose 5%-20% of my battery each night.
My solution was to reach around to the back of the tower and cycle the PSU power switch after hibernating the PC, every time.
“Full” hibernation is still there, it’s just disabled by default in the UI but not on the OS level.
There’s also this “hybrid sleep” concept introduced since Vista where an OS would go from Sleep state to Hibernate automatically after 180 minutes of Sleep (IIRC, also can be overridden by the OEM) to save the laptop battery further since after the laptop hibernates it’s effectively off.
It’s really confusing and a hell to troubleshoot if something goes wrong. I think Microsoft was trying to apply smart decisions on the OS level _for_ the user but there’s no real indication of what’s actually happening with the system. The naming doesn’t help either, especially after “Modern Sleep” has been introduced.
EDIT: I decided to check myself because I wasn’t sure and it turns out I was indeed wrong. “Hybrid Sleep” is actually about a device going to Sleep and Hibernate simultaneously - it’s so that you can still resume from the hibernated image on the disk in case battery dies while in Sleep. At the same time, you can resume from Sleep right away even before parallel hibernation is finished. I think the intention is that you kinda get the best of both worlds here.
The behavior of going to sleep to hibernate after some time which I’ve described originally is actually something that was there since at least Windows XP.
Certainly not a show-stopper, if this means not accidentally killing my €2k+ laptop because it decides to randomly wake up in my bag.
This is one thing that usually Linux gets mostly right .. only if the proprietary GPU drivers played along. Meanwhile, Microsoft and Apple certainly could implement this properly but instead decide to release a new half-assed half-hibernation after another.
I was referring to this.