You are not logged in.
Pages: 1
The new bunsen-exit (12.2.1-1) makes it possible to add "Hibernate", "Hybrid Sleep" or "Suspend then Hibernate" buttons to the exit dialogue. Whether any of those will actually work on your machine is something you will have to test for yourself, though. For what it's worth, I have an old Thinkpad laptop with encrypted ssd disk (including swap), and 'systemctl hibernate' worked perfectly right off. But for other people it did not - one case where you can expect trouble is if Secure Boot is enabled, but depending on your hardware and software any of those Hibernate-related commands might work, or not. In some cases a fix is possible, in others not...
What this boils down to is that "Hibernate", "Hybrid Sleep" and "Suspend then Hibernate" will continue to be disabled by default, but if you find one of them works on your machine, and you'd like to use it, you can enable it by editing a config file /etc/bl-exit/bl-exit.conf (Also see 'bl-exit --help' or 'man bl-exit'.)
Laptop users especially might like to use Hibernate sometimes because it shuts down the machine completely with no battery drain, unlike Suspend. Briefly:
Hibernate: store system state on disk. Takes some time both to shutdown and restore, but no power is used.
Hybrid Sleep: store system state on both RAM and hard disk (slow, like Hibernate). If battery is still up, restores from RAM, like Suspend (quick), but if battery has gone, restores from disk, like Hibernate (slow). Data is not lost.
Suspend then Hibernate: suspend to RAM (quick) and if battery is good, restore from RAM (quick). If battery is failing, wake up and go into Hibernate mode (slow to restore).
There's more on the interwebs, eg:
https://www.computernetworkingnotes.com … ystem.html
https://wiki.archlinux.org/title/Power_ … _hibernate
There was a developers' discussion on this, where a number of points came up:
https://forums.bunsenlabs.org/viewtopic.php?id=8981
In the next post I'll copy in some of the hints that came up then, but if anyone has anything to add, all advice is welcome, so please post what worked or didn't work for you, and/or what you did to fix it, or what didn't help...
Last edited by johnraff (2024-06-27 12:08:30)
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
Quotes:
For the record, this is what systemctl hibernate gave me on my (Ubuntu) laptop...
❯ systemctl hibernate
Call to Hibernate failed: Sleep verb 'hibernate' is not configured or configuration is not supported by kernel
I did search that error and tried to fix it, and got partially there (needed sudo privileges IIRC), but I gave it up as I felt it wasn't worth it on my laptop. So, yes, very dependent on the on the hardware and software used.
...UEFI Secure Boot was the warning/error/fail I got where I gave it up.
Yes, I could have configured it. No, I didn't need Hibernate that badly.
--------------------------------
Of the options when I was playing, I found hibernate better supported on old hardware than some of the other states. Of course it does require a user has enough swap configured to write the entire content of RAM to, in addition to any of the swap already in use, that'd be fairly easy to script checking.
On newer hardware ACPI is less flaky than it used to be, I'd beware of simply enabling hybrid sleep without doing some research, though I think Windows 10 & 11 do, not without creating some issues in the case of 10 on old hardware.
You'd be wanting to compare the amount of swap & RAM & probably test the content of /sys/power/state includes disk:
cat /sys/power/state
Will list the available sleep states the system declares it can do. It does so in words though.
...if a system supports the "S3" power state, that's the vital one for hybrid-sleep to function, & it's sometimes flaky on older hardware.
--------------------------------
I think I left off suspend-then-hibernate [from the bl-exit defaults] because it reliably crashed any of the old systems, or VMs running on old host systems I tested on. It also needs a setting on the HibernateDelaySec= key which elogind has in /etc/elogind/sleep.conf & systemd in /etc/systemd/sleep.conf to specify the delay between the two actions, I've no idea what the default delay is...
I think sleep-then-hibernate is mainly offered because motherboards are capable, it mostly gets used by automatic power management schemes particularly in Microsoft land, where defining a period to remain in sleep for fast wake times, & then hibernate after X minutes is useful as a battery saving/convenience compromise option, or else as an action on laptop lid closure, to give X seconds for a swift change of mind without having to complete dumping RAM to disk & reading it all in again. How useful it is to a user in practice to trigger manually I've no idea, I can't offhand think of a scenario.
Of what's not shown by default, Hibernate is the one that's really useful, particularly in the case of laptops.
...the problem is that older hardware, & (some?) virtual machines, have this nasty tendency to appear to hibernate, & then refuse to resume properly, forcing a hard reset & loss of the saved state, obviously including unsaved work.
For anyone whose system won't resume from hibernation, or is configured such that hibernating won't work, then the fix is to visit /etc/systemd/sleep.conf (or its elogind equivalent) uncomment and set the keys "AllowHibernation=no", "AllowSuspendThenHibernate=no", & "AllowHybridSleep=no" that way if attempted they'll throw an error gracefully, rather than trying & potentially losing the user any unsaved changes in documents or other data. Doing so will also cause xfce4-power-manager to lock the screen & pop up an error message if it attempts to hibernate with those keys set to no.
--------------------------------
I thought equal-to-RAM (or a little bit more to be on the safe side) was considered enough swap to hibernate. What data other than what's in memory is going to be stored? And in fact the portion of the data in RAM that actually needs to be saved is usually rather less, because a lot of it can be safely thrown away, but exactly what portion that is is so much effort to figure out that it's not worth it.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
Pages: 1