I have been using hibernate with Ubuntu 16.04 without a problem but suddenly it stopped working correctly. Whether I hibernate from the power menu or using sudo pm-hibernate
, it turns the computer off but when I turn it on again and choose Ubuntu from the grub menu, it just gives a black screen. I tried some solutions (listed below) but none worked.
I am really disappointed that with every Ubuntu release I use, I usually have similar problems with hibernate (with different laptops).
PS: I have dual boot with Windows 10, but hibernate was working perfectly with it for a long time.
Didn't work:
Best Answer
I had the same issues. There is a bug in the most recent kernel in 16.04. Here are the explicit steps I have done. Do the first one and, if it solves the problem for you, stop there. If not, go on.
1. Set the computer to boot with the previous kernel
Start with:
Mine says 4.13... Then do:
You will see the different menu entries in grub. In my case, together with "Ubuntu, with Linux 4.13..." there was a menu option to boot with the previous kernel. It said Ubuntu, with Linux 4.10.0-28-generic. In the same line you have something like 'gnulinux-4.10.0-28-generic-advanced...(a bunch of caracters here)' Copy that text, and then we have to tell grub2 to boot with that kernel by default:
Then I inserted this line:
Please do not copy this line literally, but use the output of the previous grep command as said. Then save and,
Then re-boot and check that the output of "uname -r" is the older kernel (4.10... in my case). You may be able to hibernate now, or not. If not, proceed to the next step.
2. Install different stuff to hibernate than the default one:
In my case, using the older kernel got rid of the black screen of death and allowed me to resume after hibernation, but the contents of the disk image were going wiped out, i.e. it was identical to a reboot, not hibernation. So I installed some shit that hibernates differently:
Then close the terminal, open it again and type:
This is supposed to hibernate the computer. If, after resuming, everything is as you left it, then you have solved the issue. But you still need to proceed to step 4 in order to tell Ubuntu that you want to use the new stuff by default and also that you want to have options to hibernate in the applications.
3. Tell grub 2 where the swap partition is:
It still didn't worked for me, so I had to tell grub where the swap partition is:
I could read there "# swap was on /dev/sda2 during installation", so I edited grub again:
And added:
The important part is "resume=/dev/sda2" but the previous thing (intel blablabla) is there because of other reasons. Well, the next step is:
Re-boot and try again to hibernate with some stuff going on (e.g. open a movie with vlc) with:
If the stuff is still there after you resume, you have solved the issue.
4. Telling Ubuntu to use the new hibernation stuff you have installed instead of the default:
You have now to tell Ubuntu to use s2disk to hibernate instead of the stuff that comes by default:
And insert there:
Save and close the file. Then:
And insert there:
Reboot and try again.
5. If after running Step 4, you can't hibernate using
sudo systemctl hibernate
then do the followingStep 4 is not enough to make the switch to uswsusp in Ubuntu 18.10.
Edit the hibernation service
And add the following
Update systemd
Test the setup by running the following