One of those note-to-self posts!
Why does Ubuntu come with Hibernation disabled by default?
Ubuntu had to resort to such measures as users experienced a lot of issues like:
- No resume after suspending the PC — in a limbo
- Open files and folders gone — Shutdown instead of hibernation
- Wifi etc devices not working after waking up — the worst nightmare
And that happened because there wasn’t enough Hardware support. Even in Ubuntu derivatives like Linux Mint it came disabled.
What is hibernation?
Seriously? Forget it. I am not even going to look at you.
Alright Alright suit yourself: https://help.ubuntu.com/community/PowerManagement/Hibernate
Advantages of Hibernation:
- You have an edge over “suspending”. It saves power.
- The exact state of the computer is resumed.
- Major use case for the people who leave their PCs unattended (think: http://Torrentz.in)
How to enable it in Ubuntu:
Step#1 Check if hibernate works on your hardware.
- Open Terminal (CTRL + ALT + T)
- Save your work first and then type
$ sudo pm-hibernate
- If everything goes smoothly, start your laptop and continue iff things look good.
- If you see anything unexpected then please make sure that the size of SWAP is at least as large as the RAM or just
System.exit(1)
Step#2 You can continue to use that command safely or make it permanent by enabling it on the menu (do it only if Step#1 above works)
Open terminal and type:
$ sudo gedit /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
Enter the password
(instead of `gedit` you can use `vi` its awesome)
Step#3 Paste the following lines in the blank file you created just now.
[Re-enable hibernate by default] Identity=unix-user:* Action=org.freedesktop.upower.hibernate ResultActive=yes
Hit Save and Quit.
Step#4 Reboot for the changes to take effect.
If upon restart you still cannot see the “Hibernate” item in the menu, then you need to Tweak the Grub but mostly it would not come to that.
Also check http://nikunjlahoti.com/2012/04/29/ubuntu-12-04-fix-fn-brightness-keys/
Sources:
https://help.ubuntu.com/12.04/ubuntu-help/power-hibernate.html
https://help.ubuntu.com/12.04/ubuntu-help/power-suspendfail.html


That was useful. Thanks!
I am glad I could help!
Thanks for the note.
Hi!
I enable hibernation and it worked fine but now I want to revert back.
How do I remove the hibernate button in the menu?
Thx, Seb
Wow that’s unorthodox. 🙂 I will find out + verify and let you know.
Ideally it should be as simple as removing the text file that you created “above” while enabling it.
Also, I believe there isn’t any harm in letting it be! Are you facing any issues with the Hibernation?
Hi,
Don’t bother! For info I thought it took a long time for the system to start up from hiberation, that’s why I wanted to remove it. Tried some stuff only to be stuck with a system error after each reboot so I re-installed ubuntu. I’m a newbie with Linux so that taught me a lesson!
Seb
Nice. Well re-installation is good because of two reasons.
#1 You are not removing and saying goodbye to Linux for good.
#2 You get to customize the system differently and have a clean slate.
To be on the safer side (which you do not have to be), you must install VirtualBox and try installing + using a wide variety of *NIX derivatives (flavors)! Think: Solaris. Think: FreeBSD. Think: Debian. Think: Slackware 🙂
Happy Hacking!
Thank you very much. Hibernation works like a charm on my Acer Aspire 7560G
Yay! Hibernation is such a necessity in this today’s busy world 😛 I am glad it worked for you.
Nice! That was really fast and easy!!!
Thanks for your help 😀
Happy to help ya! 🙂
When I tried “sudo pm-hibernate” it did but came back by itself, everything on its place, is it expected to hibernate until I wake it up?
Regards
Hey there.
Computer once Hibernated shouldn’t come back on its own.
Its strange that it works for you and still doesn’t.
All you need is a hack. Keep digging!!
🙂
Thank you. What “hack” do you think is needed?
I am not so sure buddy.
I would say… first find out where the logs are going… and if they say something.
Hibernate isn’t actually completely hidden by default – it does appear in the shutdown menu:
I don’t know how to actually open that menu (the command?) – on laptops the physical power button should open it.
Ok … ?
Yes pressing the power button would throw such a menu. Do you see it? It doesn’t show Hibernate for me. Does it work for you (what happens when you press it?)?
I think different Desktop Environments expose different capabilities. My XFCE on Linux Mint shows everything.
Whoops, my fail. 😀 It was your trick that added the option to the shutdown menu too… I just forgot I did the trick in the first place (and coincidentally only then found out the power button shutdown menu). So: also hidden by default, your tricks adds it there too. Hibernate works for me whatever the way.
I use default 12.10 Unity (I’m about ‘this’ close to going back to MATE though…).
😀 hehe. Alright MATE!
So after I used the terminal to pm-hibernate, once the screen went black i got an error message about some acpi device returning -6 and “failing to thaw” but other than that my computer seems to have hibernated and returned without any further problems. Is it still a good idea to activate the hibernate feature? (ubuntu noob here)
Well that depends on you. If you think Hibernate is really adding any value then its definitely worth a try.
You must make sure that everything is just the way you wanted (I mean before, after and during the hibernation)!
I mean to say if a Driver doesn’t know how to do that then when it gets back online (lets say your WIFI driver), you wouldn’t be able to browse Internet. So check if all your driver are up-to-dated (or wait-for-it). 🙂 Happy Exploring!
If everything seems to work ok, yes. I’d ignore the errer messages until problems occur in which case the error might provide a lead…
Thanks a lot, this worked great!
And your not the only one with the quarter crisis… 😉
LOL. I don’t know when thats gonna end.
😀 keep rocking
Thanks a lot… It’s work in my laptop Satellite L635…
Awesome 🙂 Thanks for the note.
Yayyyyy… I could do it…I could do it!! 🙂 🙂 Simply Awesome \m/
#Phooey 😀
Alright as this is your ‘Technical Blog’ I think I should be less informal
Amid the long list of Thank you’s that are already posted for you…I would like to add
I AM SIMPLY LOVING THE EXPERIENCE… #RaringRingtail
🙂
ALL Thanks to you Mr Digerati.
Keep Rocking!!
Simply awesome!! That’s for you. I mean given the speed with which you are reading RUTE – you are soon going to have a Technical Blog of your own 😀 Yeah! Phooey to the `less informal`!! #HappyHacking #Ubuntu
Now tell me… have you ever hibernated your PC after that?? 😀 I mean I do not. Don’t know why!
Haha 😀 😀 I didn’t … I didn’t!! I am not sure why.. but I remember giving you something as an answer 😀 😀
And after vainly trying to understand all your Technical blog-posts… 😐
I could finally implement One…no wait…TWO Yaaayyy Yaaayy!! 🙂 🙂 #FeelsGood
My Technical blog…Yo… That tickled my fancy!! 🙂 😉
Learning RUTE is definitely FUN 🙂 Thank YOU!!
Yoohoo! Keep Rocking! Looking forward to read your blog soon 🙂
For some reason the hibernate option does not appear in 13.10 after upgrading to it. The .pkla file is still there. Made an entry on askubuntu: http://askubuntu.com/questions/361058/
13.10 has a bug, the menu entries can not be enabled for now: https://bugs.launchpad.net/ubuntu/+source/indicator-session/+bug/1232814
Thanks for the note Timo. I will post back if I figure something out.
WHEN I RUN THE COMMAND SUDO PM-HIBERNATE THE SCREEN GOES BLACk for a second and displays :
cannot find swap device, use swapon -a
and the sreen again comes back . any suggestions???
Hey Hemant, I am sorry I couldn’t respond earlier.
When you install a Linux system in a custom mode you need to make sure that you explicitly create a swap partition (of at least the size – 1.5 * size of RAM). Its essential for hibernation to happen.
https://wiki.archlinux.org/index.php/swap#Swap_partition
http://en.wikipedia.org/wiki/Paging
Just create the swap partition and you’re good.