There is a problem I haven't been able to solve yet, and doesn't seem to be much discussed.
I recently enabled hibernation on a swap partition on Ubuntu 22.04 by adding
resume=UUID=UUID_OF_MY_SWAP_PARTITION in the line
GRUB_CMDLINE_LINUX_DEFAULT of my
/etc/default/grub file and
RESUME=UUID=UUID_OF_MY_SWAP_PARTITION in the file
/etc/intramfs-tools/conf.d/resume. This enabled hibernation successfully, and I see the menu entries and can hibernate whenever.
I have no problem hibernating then waking, and suspending then waking. Everything works very well.
I also disabled Hybrid Sleep in a file in
/etc/systemd/sleep.conf.d/ and set the delay for suspend-then-hibernate to 60 min ; here's the content of this file
The behavior I want is lid close or sleep key or inactivity to do a classic suspend, and any of these classic suspends, whether plugged in or not, to hibernate after 60 minutes. Without changing the behavior of any command, this is indeed what it does. Waking when it is in suspend mode does work, and hibernation successfully happens after 60 minutes of being suspended. However, when hibernated this way and only when hibernation came from a suspended state, I can not boot again : turning the computer on goes to the grub screen as it should (dual boot), and choosing Ubuntu doesn't boot completely : I instead get a message on a command-line-like black screen.
I tried performing the bug again to copy the error message, but today it doesn't write anything! Just a black screen! Also in the next few days, it booted until login screen, where it dispalys the time before asking for session password, but it was stuck on the time without accepting input. I don't know what caused this change of behaviour. Users on forums have had this kind of problem with suspend (not suspend-then-hibernate), with this message :
Bluetooth hci0: Timeout waiting for suspend events
Bluetooth hci0: Suspend timeout bit: 6
Bluetooth hci0: Suspend notifier action (3) failed: -110
My error message is very similar. It is also three lines, and the first line is definitely the same. The two next lines I'm not sure, even less of the numbers written, but they did look similar. I checked again in the logs but couldn't find it.
And then the computer doesn't accept any input and won't boot ; I must turn off with the power button (or REISUB) and turn it on again - which kind of defeats the purpose of hibernating...
I tried to look into the logs but I'm not sure which log to check, and didn't find anything that really seemed relevant. But I'm not very good at this, so if one of you wants me to look up something specific, I certainly can!
For information, I am on a DELL Precision 7520 laptop, with a fresh Ubuntu 22.04 install on an SSD I added myself, dual-booting with Windows 11 installed later on. Both these partitions, two data partitions and my swap partition are on the SSD. There is also an HDD that is used for data storage only.
I'm sure it's easy to fix, but I have absolutely no clue as to what to do.
Thank you very much for your help, and I will provide any further information you want.
Using kernel boot option
mem_sleep_default=s2idle, as suggested in the comments, didn't have any effect unfortunately.
While I can't really make sense of the log files, there seemed to be a bunch of nvidia messages. I remembered on the same computer, but long ago like ubuntu 16.04 or 18.04, I had wake problems (not after hibernation, just regular sleep) and eventually switching to server nvidia drivers did the job. In this case, I tried many available nvidia drivers, whether server or not, in Software & Updates, but to no avail.
I initially wanted to do this in order to save energy. Since I have a SSD, waking from disk is quite fast, so I settled on disabling RAM sleep altogether and going for hibernate all the time.
I first tried to have a .conf file in
/etc/systemd/logind.conf.d/ say that every power action is hibernate :
but strangely it didn't suffice (lid switch did hibernate, but not suspend key). Changing a conf file in
/etc/systemd/sleep.conf.d/ to have
SuspendState the same as Hibernate didn't work either. I had to create a link
sudo ln -s /usr/lib/systemd/system/systemd-hibernate.service /etc/systemd/system/systemd-suspend.service
and now it works, I don't have "classic" suspend anymore, it just hibernates all the time.
It's okay for me this way! Maybe this can help someone, though the root problem is still not solved.
Thanks for your help :)