19

I installed Freya three days ago on my main machine, and I faced some issues with the hardware. But I got it to work at last. But the lack of hibernation support in Freya is causing me to seriously reconsider installing another distro (which would be a pain after solving most of Freya's problems).

I am used to hibernation so that I can continue from where I left off the next day. But apparently, Freya doesn't support this (does it ?). I tried installing pm-utils and invoking sudo pm-hibernate but that didn't work. In fact, pm-hibernate seems to be hardware-dependant because I saw that it worked on other machines.

All other solutions I found seems to be Ubuntu-Specific.
Any ideas ?

  • this is work for me, run in freya + acer e1-471 – user952 Aug 18 '15 at 4:58
16

I tried installing pm-utils and invoking sudo pm-hibernate but that didn't work.

Can you be more specific? As @Lewis noted, hibernate is disabled by default (even in Ubuntu). If you wish to hibernate manually with pm-hibernate examine the pm-utils logs (less /var/log/pm-suspend.log) for clues.

Enable Hibernate

If everything appears to be successful in there you more than likely just need to add a parameter to your boot options so the kernel knows where (eg your swap partition) to attempt to resume the system from.

Firstly you should make sure your swap partition is larger than your RAM. sudo fdisk -l and free -h can be used to check this. Note the device ID of your swap partition.

If so, edit your grub config via sudo scratch-text-editor /etc/default/grub and search for the line with GRUB_CMDLINE_LINUX_DEFAULT then add the resume option to the end containing the device ID of your swap partition.

Similar to this GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=/dev/sda2"

Be sure to run sudo update-grub afterwards to apply the changes.

Add Menu Item

You can add a hibernate option to the wingpanel power dropdown by creating the following file in a terminal.

sudo touch /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
sudo scratch-text-editor /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla

Add the following, save the file then reboot. Source.

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

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

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

elementary OS Freya is designed to resume from where you left it even when you Switch Off the machine. For instance, opening Scratch will, by default, open all the files you were editing last time. As such, a design decision was made to remove it, coupled with the fact that hibernate is hardware dependent, and does not work on many systems.

  • 1
    Some apps are designed to resume where you left, some do a better job than others (e.g. Terminal gets cleared; Files only restores one window, with one tab), and the OS always starts blank so you have to restart apps and arrange them on workspaces on every boot. – quassy Jul 31 '15 at 14:43
  • 3
    Hibernation is ought to work on most modern machines. At least, Windows was able to do so on, so far, literally every machine I installed it on. – Amr Ayman Jul 31 '15 at 18:49
  • 1
    Windows has the benefit of every hardware vendor actually developing drivers for it. Linux doesn't. Despite this, more often than not hibernate actually does work on Linux, though rather than have it fail and you lose data etc. it is common for distros to disable it by default. – elmato Aug 1 '15 at 0:01
4

Aside from already suggested answers (force enabling of hibernation, and normal shutdown as apps should resume where they left, which obviously doesn't work for non-elementary apps like LibreOffice etc.), there is a third option:

Suspend. If you just want to start a new day where you left the day before, the prefered way is to suspend rather than hibernate. It works on every hardware (contrary to hibernation), is faster and more easy on your machine, especially if you have older one. A little drawback is it takes a little power to keep the machine suspended.

  • Upvoting this because I agree. Entering and resuming from suspend is considerably quicker than from hibernation on my laptop. – elmato Aug 10 '15 at 13:26
  • 1
    But it will consume power. And there is a possibility that computer will shutdown because of low battery. – shantanu Oct 2 '16 at 19:37
  • That's true and I mentioned it in my answer, however OP's scenario deals with continuing work the next day and any battery not older than few years should survive whole night just fine. – jena Oct 3 '16 at 11:07
  • 3
    Not the same at all. Hibernation will allow you to switch to another operating system if you dual-boot, and then resume your session. – nkkollaw Oct 29 '16 at 18:57
  • I didn't know that, thanks. However it wasn't asked for in the original question either. – jena Oct 30 '16 at 9:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.