No Hibernation action on critical battery


#1

Today my Librem15v3 ran out of juice as I forgotten to plug it in. I was too busy to notice the low battery warning. However, to my surprise the laptop did no Hibernate when the battery went below 3% and eventually the laptop powered off comletly without a proper shutdown. I didn’t loose much work, however, upon doing a little research I realised that the UPower configuration of the laptop should have triggered a hibernation. Here is my /etc/UPower/UPower.conf settings,

# Only the system vendor should modify this file, ordinary users
# should not have to change anything.
PercentageLow=10
PercentageCritical=3
PercentageAction=2
# If HybridSleep isn't available, Hibernate will be used
# If Hibernate isn't available, PowerOff will be used
CriticalPowerAction=HybridSleep

the percentage low/critical limits seem to be working as the latop is displaying warning msgs. However, is it possible the laptop is not hybernating because it isn’t available and instead it is going into PowerOff?


Encryption password skipped at boot time after update
Hibernation / Hibernate on Librem
Encryption password skipped at boot time after update
Hibernation / Hibernate on Librem
#2

I just tried to hibernate the laptop without any success by enabling the hibernate on power button press feature.

I read somewhere that hibernate uses the swap partition to save the ram to disk. My swap partition is 2Gb, is it too small to accommodate a ram image?


#3

The swap partition for hibernation should be the RAM size and then some. 2GB seems to be much less then available ram in Librem15. Try extending its size to (RAM + 1)GB


#4

Swap partition size don’t need to be same as RAM but at least needs to be the same RAM that you’re using before hibernate, it’s unusual to use more than 2GB but to be sure you can set t at 3 or 4GB


#5

thank for that tip.

Ok, I just realised that I don’t have a swap partition… I mistook my rescue partition for the swap.

Quick question, my laptop came with its main partition encrypted (fs:crypt-luks) which occupies all the space on my ssd drive, so can I shrink it using gparted to make space for a swap partition?

[EDIT] ok, gparted does not support encrypted partitions. So the question is now, what tool can I use to shrink my partition?


#6

Another way would be to setup a swap file and hibernate to that. But I haven’t used that in practice, let alone on an encrypted partition. So can’t help you much more.
Maybe this can get you going:
https://wiki.debian.org/Hibernation/Hibernate_Without_Swap_Partition


#7

You can/should get your swap within the encrypted partition. Just think of it that way: if the swap is not encrypted, then your memory that does include the decryption key will be written in plain in the swap. Not good :slight_smile:

I don’t know what the default install layout was given I had a crash on first boot that broke things™, but if it’s anywhere standard you should have lvm inside the swap partition so it should be possible to resize things a bit and create a swap partition there. I’m actually surprised there wouldn’t be one by default…


#8

good point. I was in 2 minds as to make the swap encrypted too or not.

did you mean inside the main partition? lvm … ok so it should be possible to simply shrink the root and make space for an additional volume for the swap all within the encrypted partition. Is my reasoning on the right track here?

ya, I would have expected one too. Maybe there is a good reason why not.


#9

thanks that is also an interesting approach.


#10

I cam across this interesting thread about reasons why not to have swap partitions/files on high-RAM ssd systems. The author of the accepted answer suggest instead to have a suspend-to-ram which I believe my LIbrem15v3 is configured to do as the default suspend.

The initial argument to write less to an ssd would apparently be less valid with modern SSDs as their capacity for write-capacity is much higher. Anyone knows what kind of limits Librem SSDs are designed for?

Coming back to my initial question, my UPower.conf is set for,

Which according to this wiki page is possibly both a suspend-to-disk and a suspend-to-ram ? Can I do the following to simply suspend-to-ram,

CriticalPowerAction=Suspend

So at least I don’t have brutal power off.


#11

apparently not according to this thread. The answers that suggest changing settings in the dconf-editor are not available in PureOS.


#12

I can now happily report that with the latest PureOS update, the critical battery action is working and my librem15 now gracefully shutsdown when battery % reaches the critical setting.


#13

hi @mladen I am re-opening this thread as subsequent updates have broken this again. The laptop simply keeps running till the end of battery and finally switches off.


#14

Please report to our tracker with as much details as you can gather: https://tracker.pureos.net/


#15

Done! Here is the tracker issue.


Is anyone else experiencing freezing issues with Librem 15 v3?