How should I successfully hibernate Ubuntu 16.04?
I've tried almost every solution on the web but non of them was actually helpful. I found my problem almost completely similar to this one
|
You can use sudo pm-hibernate to check if hibernate works on your system. If it does not work , check if your swap size is at least as large as your RAM. To add the option to the settings menu, you can create a configuration file. Open a terminal window and run this command:
It opens nano with an empty file. Copy the lines below and paste them into the nano window.
Then save the changes and close nano and reboot the system to make Hibernate available appear on "Power options". Reference: How do I hibernate my computer? in the official documentation for Ubuntu 16.04. Hope it works. This worked for me after trying all other options. |
|||||||||||||||||
|
Hibernation using
|
|
|
Where is that information from, that 2/5 of the RAM size might be enough, and under which circumstances? I have a user option in Gnome, "Hibernate" and it does seem to hibernate, but on waking up, it doesn't work properly. I have a swap partition of 8GB and 32GB RAM. That's not 2/5, but before creating a 32GB swap file (or partition) it'd be nice to know.
– cslotty
Dec 13 '16 at 15:11
|
||
|
|
@cslotty I got that information from the Arch wiki IIRC - let me know if you do manage it please
– Zanna
Dec 13 '16 at 15:52
|
||
|
|
Thanks, @Zanna. I found out that it's actually not hibernate, what I want, but suspend (S3/STR) - sry.
– cslotty
Dec 13 '16 at 16:36
|
||
|
|
@cslotty no worries at all. In that case, swap is not your problem as it's not related.
– Zanna
Dec 13 '16 at 16:53
|
||
|
Thanks, I needed a synthesis of this answer as well as the tip on disabling SecureBoot to make it work in the end.
– oligofren
Dec 18 '17 at 12:55
|
|
I think, how to enable hibernate for 16.04 answer is known to all as described in the Ubuntu Wiki (See below if you need the steps). But The things that need checking isn't thorough I think. At least, that's what I found. Things to checkFrom my own tests, I've at least found one extra check that you should perform. I haven't found about it anywhere in the Internet. Here are some checkings -
Steps to enable hibernateIt involves these steps
It should enable hibernate. |
|||||||||||||||||||||
|
Secure Boot(I asked a similar question asking for a focus on systemd-based replies, sharing my solution here for people following this question) This solution comes from Fedora topics (they made the switch to systemd a while ago so there's more material there). In my case (fresh 16.04.1 install on a machine that always supported hibernation), calling the obsolete
It turns out that secure boot was the culprit: installing 16.04 you are asked what you want to do with it (which is a new thing as far as I can recall) and I kept it ON without giving it much thought. On my machine with secure boot ON,
After reboot and disabling secure boot in the BIOS settings (these are machine-specific, but usually pretty straightforward) I tried a
which looks better. And indeed calling Moreover, after that I could see hibernation available as an option in various places of the graphical interface, without the need of any |
||||
|
|
|
First, I do recommend that you test if your machine supports hibernation, because the reason why hibernation is disabled by default is because it sometimes has unpleasant results on some machines. Test your machine by opening the terminal (Ctrl+Alt+T) and then typing Your machine should hibernate. Wake your machine up after hibernation and observe if it misbehaves or if it acts normally. If you experience any abnormality after the hibernation, then I advise you don't continue with the following procedure. However, if it works just fine, continue to activate hibernation by doing this:
Edit the opened file and add this lines:
After this, restart your machine, and after logging in, you should see a hibernation option added on the power menu, on the top right settings corner. |
|||||||||||||||||||||
|
|
Expanding on my own comment to kelvinelove's answer, the file he suggests editing did not exist on my system (fresh Ubuntu 16.04). Instead, I did this:
EDIT: Gunnar pointed out that this file gets overwritten if a certain package gets updated, so depending on your intentions it is most likely not the best solution. Source: http://www.zedt.eu/tech/linux/enable-hibernation-xubuntu-16-04/ |
|||||||||||||
|
|
There are some very good resources here to help you sort out some of the more common hibernate issues under Ubuntu. In my case, running Ubuntu 16.10 on a Lenovo u300s, in order for hibernate to work correctly I had to do the following:
The RESUME refers to your specific swap file UUID. In particular, on my machine setting Best of luck! |
|||
|
|
|
For me, it works to install |
|||
|
|
|
You have to manually enable it with a little effort. It's been disabled by default. http://ubuntuhandbook.org/index.php/2014/04/enable-hibernate-ubuntu-14-04/ Then, if it doesn't work, it's might be a 4.4.0 kernel issue, and you might have to upgrade kernel. |
|||||
|
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
sudo pm-hibernatework? – Pilot6 Aug 1 '16 at 9:01systemctl hibernateso perhaps not a dupe... or at least updated answer may be required to make the old question valid to dupe – Zanna Aug 1 '16 at 21:03uname -rin the terminal (apologies if you already knew this). – WinEunuuchs2Unix Sep 2 '16 at 1:47freeso we can determine if you have enough swap setup to successfully hibernate. – Elder Geek Sep 4 '16 at 18:15