Hibernation with Librem 13v3/2

Is there a way for me to get hibernation working on my Librem 13v3 without having to reinstall PureOS? Right now I have no option to enable it.

It’s become a bit complex with systemd;
https://www.freedesktop.org/software/systemd/man/systemd-sleep.conf.html

But the easier way is to go to settings;

  • Go to settings
  • Choose Power
  • At the bottom, choose for the value Hibernate for the When the Power Button is pressed

Now you can just click the power button to suspend.

Many thanks. For some reason, prior to just checking, there was never a hibernate option availible. After just looking there was an option for it.

I really like how closing the lid puts the librem to sleep, and you can quickly get started again later. However, sometimes when I’m not going to use the laptop for a while, I prefer not wearing the battery done for nothing.

Thanks for the response!

1 Like

Glad I saw this.

So now I have it going to hybrid suspend when I close the cover (so that if the battery runs out while it’s shut, I don’t lose my session) and hibernate when I hit the power key (which I’ll do if I know it will be a while.

How did you change the lid closing behavior? I looked around but didn’t see that.

Also I installed a gnome extension to add a hibernation button on the power selection, and it appeared to work, however, when I turned it back on, it started up as if from a cold boot. (IE: My session was gone.)

Does having your hdd encrypted mess up hibernation?

There was a topic regarding hibernation quite a while ago. What i directly can remember:

  • swap-partition has to be big enough to accept the whole RAM-size + x (otherwise the hibernation-box ticked doesn’t do anything)
  • real hibernation didn’t work for me - just sleep
  • if the akku is going towards zero, the laptop doesn’t fall into hibernation, but switches off - so cold boot next time

Found it: Have a look https://forums.puri.sm/t/hibernation-hibernate-on-librem/3432/14

The last message might be a solution. Didn’t find the time to try myself (respectably i’m not confident enough with linux-internals to risk shooting my right now mostly stable system :wink: ).

I’m going to circle back around on this one, as I FINALLY got it working.

Granted i’m on Ubuntu 20.04 now, but this should work on PureOS as well provided you have the space for a swap.

I’m only going to give a brief what I did below, but you’ll need to do some searching online if that is not enough for you.

The first thing you need to do is create a swap partition that is big enough to hold your session. Using the amount of ram you have installed is required, as anything smaller and hibernation will not work. *

Once you have created said partition and made it active, you’ll need to get the UUID for the new partition, and add it to your grub, and appending to the default: resume=UUID=YOUR_SWAP_UUID

From here update grub (sudo update-grub).

On Ubuntu, you’ll need to unmount the 1gb swap it creates by default, before trying it out. Once you have done all of this you would type: sudo systemctl hibernate

If it works, your screen goes blank as the contents of ram are dumped into the swap partition. When that is finished the machine turns off.

Turning it back on, you’ll need to enter passwords to decrypt your encrypted partitions. Once that is successful, you’ll see that it says it is resuming using the UUID image you specified.

Viola. It works. No more draining battery when you know you wont be using the laptop for an extended amount of time. Welcome to the 21st century.

  • if you wish for this partition to be encrypted, you’ll need to sort that out. Disks and gparted can be used in conjunction to resize (shrink or expand) any of your current Luks partitions. Very useful tools for sure.
1 Like