I know that since 12.04, we need to add a policykit rule to enable hibernation (see question How to enable hibernation? and the Official Documentation).
I can successfully bring my laptop into hibernation mode with sudo pm-hibernate
or sudo s2disk
, so the rule is in place and works, but the hibernation entry is still missing in the menu.
I can tell from looking through the source of the indicator-session package (but not understanding the whole code) that there is still a hibernation menu entry in the code and it should be displayed when the system is capable of hibernating. Please calm down if you're enraged by this. This is very unlikely to be a conspiracy, but rather a bug/regression on a deeper level, which can happen when you move code around or replace it.
Question: What needs to be done in 13.10 to properly tell indicator-session
that the system can hibernate?
Possible duplicate: Hibernation still not available - No activity, because saucy was in development at that time, so out of scope for AskUbuntu.
Related bug report: https://bugs.launchpad.net/ubuntu/+source/indicator-session/+bug/1232814
14.04 and beyond
Mitch points out in his answer for 14.04 and 16.04 that you should check
10-vendor.d/com.ubuntu.desktop.pkla
before modifying anything. Also check that you have Secure Boot disabled and if that brings the menu option back.Re-enabling the hibernation option in the menu
To re-enable the hibernation option in the menu, your
/etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
should be modified to look like the following in saucy (13.10):Then reboot or run
killall indicator-session-service
in your session and you should have your hibernate functionality/menu option back. Create the file if it doesn't exist already.Investigation from bug report
Citation from Jeffery To's post on Launchpad Bug Report #1232814:
All thanks and credit go to Jeffery!
Why was hibernation disabled?
There exists a bug report on launchpad that suggests disabling suspend/hibernate instead of tracking which hardware "certifies" for which power modes. It's claimed to be a more scalable approach.
Another thing to mention is that using UEFI Secure Boot and hibernation appears to be possible but may be a risk to circumvent the former. (1, 2) As a reminder, when you use hibernation you store everything in RAM to disk without encryption, this includes passwords for encrypted filesystems and containers.
At some point with 16.04 I had to disable Secure Boot to be able to hibernate my laptops. In my case I used uswsusp and testing with s2disk returned the message below. This may give you a hint that your issue, why you can't hibernate although everything else is in place, is related to Secure Boot:
However, please understand that this is not a place to complain and please be nice.
Related questions
If you still have problems in making hibernate work, check comment #58 on this bug report:
Installing hibernate package seems to make the right changes and it worked very well for me in ubuntu gnome 13.10 x64
If you have followed the previous steps and it still hasnt worked, I suggest that you change your
/etc/pm/sleep.d/20_custom-ehci_hcd
to:to make it work, then follow the steps mentioned above to enable the hibernate option. This really worked for me.
At the end you are gonna have 2 files edited with "
[Re-enable hibernate ... ]
" Try this one. It will work for sure if you are using ubuntu 13.10One thing I would like to add here, which AFAICR, is unmounted swap partition. If the swap partition is not mounted the hibernate option will not be displayed/enabled irrespective of the hibernation configuration.
And if the swap partition doesn't automount then the hibernated session would be lost.