• Sign in to Neowin Faster!

    Create an account on Neowin to contribute and support the site.

Sign in to follow this  

How To Enable Hibernation in *buntu 14.04

Recommended Posts

simonlang    530

 

This simple and brief tutorial is going to show you how to enable the hibernate feature in Ubuntu 14.04 Trusty Tahr.

Hibernate is disabled by default in Ubuntu, when the computer hibernates, all of your applications and documents are stored and the computer completely switches off so it does not use any power, but the applications and documents will still be open when you switch on the computer again.

hibernate-ubuntu1310.jpg

 

To enable hibernate, you actually have to have several things done:

 

- make sure, your swap partition is at least as big as your installed RAM. if you don't have a swap partition yet, create one using gparted for exmaple. as soon as it's created, activate it and it will be used right on.

 

then:

first, open Konsole and create/opem the following file via your favorite text-editor, here i am gonna use kwrite

sudo kwrite /var/lib/polkit-1/localauthority/50-local.d/hibernate.pkla

then, copy-paste the following content:

[Re-enable hibernate by default in upower]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes

[Re-enable hibernate by default in logind]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate
ResultActive=yes

save the file.

 

this gives you the entry seen in the screenshot above, however the system still needs to know, when it wakes up, if there is a written hibernate file on the swap partition and if it exists, grub2 needs a command to boot it instead of just booting the normal system.

therefore you need to add the UUID of your swap partition with a resume command to your grub_cmdline parameter.

 

first get the UUID of your swap partition, for example by opening Konsole and type:

sudo blkid

will list you all partitions. look for your swap partition and it's UUID for example:

6a12a4d5-e9e6-4568-afcc-34c70b24a668

Then in the Konsole enter:

sudo kwrite /etc/default/grub

this will open your grub config file, check for GRUB_CMDLINE_LINUX_DEFAULT (in my case it was line 11) it will look like:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

change it to make it look like this:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID="6a12a4d5-e9e6-4568-afcc-34c70b24a668"

save the file and do a reboot.

 

you should now have a working hibernation function with the entry in the startmenu. 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.