Hibernate After Extended Sleep Possible?

Hey Guys,

Is it possible to have my computer go into hibernate mode if it’s been in standby (sleep) mode for a few hours? Looking to maximize my battery life…I know Windows does this already, so wanted to replicate something similar in Linux. I tried the steps outlined here for Ubuntu:

Extend Hibernate Steps:
https://askubuntu.com/questions/12383/how-to-go-automatically-from-suspend-into-hibernate/1075860#1075860

But it doesn’t work consistently, and will only work sometimes on my Manjaro Gnome system.

Anyone that can help me sort this out and get it working consistently, it would be GREATLY appreciated!

The answer should be in here:

Power management - ArchWiki

There is hybrid-sleep and suspend-then-hibernate.

With hybrid-sleep it’ll go to suspend to RAM
wake up and also suspend to disk
so that when the battery is used up
it’ll resume from disk instead of from RAM.

Of course, resume from disk isn’t going to be as fast as resume from RAM
should the battery be depleted and the content in RAM is lost.
But it’ll resume the same.

Correct, the link I put in my original post utilizes the “suspend-then-hibernate” method. The issue is that it is not consistent.

I - and likely anyone else - don’t know what you actually mean by that. :wink:

Sorry, let me try to provide some details. Some times when I close the lid of my laptop (and it goes into suspend state) the computer will then end up hibernating correctly. Other times, the computer will remain in suspend state and appears to never enter into the hibernate state.

So, basically I am trying to troubleshoot the random occurrences when it STAYS in the suspend state and never enters hibernate state correctly.

suspend-then-hibernate or hybrid-sleep
My system (as it’s supposed to) will
suspend to RAM
wake up
suspend to disk
and then return to the suspend to RAM state
where resume is fast

It’ll be in a suspended state as long as the battery lasts.
If that is lost due to no power it will resume from disk the next time there is power and it is turned on.

For suspend to disk, enough swap is needed.
So that could be a possible issue.

I still haven’t got what your issue is - how it manifests itself - what is happening vs what you think should be happening.

So, I’ll try this again with current state vs. what I want to occur (intended state).

Current State:
-Close the laptop lid, laptop enters suspend state to RAM.
-Open the lid, computer resumes from suspend state instantly (from RAM).

There is no hibernate (suspend to disk) that occurs. Again, this does not happen EVERY time, sometimes the intended state actually gets triggered correctly:

Intended State:
-Close the laptop lid, laptop enters suspend state to RAM.
-Computer wakes up and then suspends to DISK (hibernate state) after a certain period of time.
-Open the laptop computer remains “off” and I have to push the power button.
-Computer then resumes from hibernate state (from disk) after a few seconds.

Again, the issue here is the intended state (suspend to disk) does not occur consistently. Specifically, everytime I close my laptop lid, I am unsure if the computer will suspend to RAM or suspend to DISK (which is the behavior I want). The link I pasted in my original thread goes into the configs I modified (sleep.conf, logind.conf, etc.) and steps I did to configure the ‘suspend-then-hibernate’ method on my laptop to work.

If this is still not clear, please let me know, and I will try and provide additional details. Thank you in advance for your time and help, it is greatly appreciated.

I have to say that I didn’t even look at this nor have I read through it.

Instead, I posted a link to the Arch Wiki
where the setup of this
on Arch style systems
is explained.

Since Manjaro is basically Arch (in this respect for sure)
you should refer to this for information on how to configure that.

Maybe it’s the same - it’s even likely.
But I didn’t compare the two sets of instructions.

I know that I never did even touch
sleep.conf

I’d recommend:

  • restore to original
  • go by the Arch guide

… and I’ll go to sleep myself right now - someone else might have good advice for you
I’ll not be back for about 20 hours.

Makes sense. I think to help troubleshoot the issue “fully” it probably doesn’t hurt to at least take a look a the Ubuntu link I provided to get some more context on what I am trying to achieve (what I think should be happening). I think at the very least that would help you understand the original question of what I am trying to achieve.

I will look at the arch guide you provided and see if I can follow the specific steps required.

Thank you.

I think we do have a good understanding of what it is you are trying to achieve.

I’m just hesitant to reading through and trying to assess the info in that ask ubuntu link,
keep it all in my head
and compare it with the Arch guide.

Me - I’d never have considered consulting an Ubuntu “guide” when a dedicated Arch guide is available.