You are not logged in.

#1 2016-09-28 03:39:46

S3NTYN3L
Member
From: Blito-P3
Registered: 2015-07-29
Posts: 43

[SOLVED] Hibernate on Lid Close?

I'm reading through; https://wiki.archlinux.org/index.php/Po … ibernation

Can someone be so kind as to confirm I'm understanding things properly?

I know I need to do this;

Add

resume=my_swap_partition

to

/boot/loader/entries/arch.conf

But where exactly? Can it go anywhere?
My options line currently looks like this:

options= root=PARTUUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx quiet loglevel=3 rd.systemd.show_status=auto rd.udev.log-priority=3 rw

Secondly, I'm unsure about whether or not I am also required to add the resume hook, after the base & udev hooks of course, to

/etc/mkinitcpio.conf

I ask because the wiki page talks about "Hibernation into swap file" beforehand, so I'm not sure that it pertains to JUST swap file use cases or to my swap partition case as well.




Thanks in advance for your help.
Sorry for my stupid newbishness...

Last edited by S3NTYN3L (2016-09-30 02:32:40)

Offline

#2 2016-09-28 13:52:21

flortsch
Member
From: Linz, Austria
Registered: 2015-07-21
Posts: 39
Website

Re: [SOLVED] Hibernate on Lid Close?

Hey,

you can add the resume kernel option anywhere in the config file.
Whether you use a swap partition or a swap file, you always have to specify the resume kernel parameter.
As the wiki says: "When an initramfs with the base hook is used, which is the default, the resume hook is required in /etc/mkinitcpio.conf"
Therefore yes, you also have to provide the resume hook in mkinitcpio.conf, unless you have a non-default setup of your initramfs.

Edit:
I think you have to remove the equal sign after the options keyword in your boot loader config file.

Last edited by flortsch (2016-09-28 13:55:33)

Offline

#3 2016-09-28 14:56:12

JohnBobSmith
Member
From: Canada
Registered: 2014-11-29
Posts: 804

Re: [SOLVED] Hibernate on Lid Close?

Don't beat yourself up as this is a perfectly legitimate question. A couple of things...

I'm assuming you are using systemd-boot. Therefore, the option resume=swap_partition goes at the end of the options line like so:

options= root=PARTUUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx quiet loglevel=3 rd.systemd.show_status=auto rd.udev.log-priority=3 rw resume=swap_partition

Do use a real value for this, of course. Next, as flortsch said, you will need to re-build the initramfs. There is a wiki page dedicated exclusively to this. Following the hibernaiton page, do put resume after the base and udev hooks in /etc/mkinitcpio.conf Finally, How much ram do you have and what is your partition scheme? Can you post back the output of lsblk and free -h in code tags? This will allow us to make sure you will be able to suspend to disk correctly.

Good luck!


I am diagnosed with bipolar disorder. As it turns out, what I thought was my greatest weakness is now my greatest strength.

Everyday, I make a conscious choice to overcome my challenges and my problems. It's not easy, but its better than the alternative...

Offline

#4 2016-09-28 16:47:47

S3NTYN3L
Member
From: Blito-P3
Registered: 2015-07-29
Posts: 43

Re: [SOLVED] Hibernate on Lid Close?

Yes, I'm using UEFI/GPT and systemd-boot

lsblk looks like;

sda1     512M     /boot
sda2       8G     [SWAP]
sda3   457.3G     /

free -h looks like;

       total     used    free    shared    buff/cache    available
Mem:    3.8G      82M    3.6G      828K           72M         3.5G
Swap:   8.0G       0B      8G

Last edited by S3NTYN3L (2016-09-28 16:48:48)

Offline

#5 2016-09-28 16:59:52

JohnBobSmith
Member
From: Canada
Registered: 2014-11-29
Posts: 804

Re: [SOLVED] Hibernate on Lid Close?

This looks good. The only thing left to do now is replace resume=swap_partition with a real  value and update the initramfs. So...

Get the partition UUID we are interested in:

ls -l /dev/disk/by-uuid

Match output of this with the output of lsblk. In this case, you will need the UUID of your swap, /dev/sda2. Use this as the value for your resume line, but make sure it looks like this:

options root=PARTUUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx quiet loglevel=3 rd.systemd.show_status=auto rd.udev.log-priority=3 rw resume=UUID=<the value you got from earlier>

As per the wiki. Update the initramfs and let us know if it works smile

EDIT: Do remove the equals sign as mentioned earlier. Good luck!

Last edited by JohnBobSmith (2016-09-28 17:01:39)


I am diagnosed with bipolar disorder. As it turns out, what I thought was my greatest weakness is now my greatest strength.

Everyday, I make a conscious choice to overcome my challenges and my problems. It's not easy, but its better than the alternative...

Offline

#6 2016-09-28 17:58:43

S3NTYN3L
Member
From: Blito-P3
Registered: 2015-07-29
Posts: 43

Re: [SOLVED] Hibernate on Lid Close?

The equals sign was a typo on my part while writing my post.
It wasn't in my arch.conf file when I went to edit it again.

Hmm, it doesn't seem to be working like it should. hmm

I close the laptop lid and the screen turns off, the wifi light stays white (wifi connected).
Opening the lid, it seems as if the laptop is merely coming out of a suspend to RAM state.

If I run the systemctl hibernate command, the screen shuts off and the wifi light turns orange (wifi disconnected).
Closing and/or opening the lid does nothing. Keyboard presses also do nothing.
I am forced to press and hold the power button in order to shut it down/hibernate.
Pressing the power button once more will bring the machine out of hibernation.


Any ideas?

I'm wanting the machine to hibernate when I close the lid and to wake up when I open it.

Perhaps it's something to do with logind.conf settings?

Offline

#7 2016-09-28 18:06:44

JohnBobSmith
Member
From: Canada
Registered: 2014-11-29
Posts: 804

Re: [SOLVED] Hibernate on Lid Close?

What is the significance to you regarding suspending the system to RAM versus hibernating? Is there a preference for one or the other?? I never use hibernate/suspend; my system is always on and in use or off.

The only thing I can think of is that you didn't update the initramfs. That would do it. If you're sure the initramfs and the bootloader configuration is correct, then I'm not sure what might be causing your issues. One thing to note is that the initramfs change would, AFAIK, occur on the next boot. Because you've already rebooted once, see if it hibernates correctly this time.


I am diagnosed with bipolar disorder. As it turns out, what I thought was my greatest weakness is now my greatest strength.

Everyday, I make a conscious choice to overcome my challenges and my problems. It's not easy, but its better than the alternative...

Offline

#8 2016-09-28 18:18:31

S3NTYN3L
Member
From: Blito-P3
Registered: 2015-07-29
Posts: 43

Re: [SOLVED] Hibernate on Lid Close?

Before posting my previous reply, I made the changes and updated both the initramfs as well as the bootloader.
I then rebooted the machine and started "testing". I've even triple-checked the relevant .conf files and they seem to be just as described in this thread. hmm

I was wanting the machine to hibernate for zero power consumption as described in the wiki page in my OP.

I suppose I can just undo my changes and live with the suspend to RAM behavior...

Offline

#9 2016-09-29 07:37:22

Chazza
Wiki Maintainer
Registered: 2013-06-02
Posts: 506

Re: [SOLVED] Hibernate on Lid Close?

Have you seen this section of the article you linked to?

Offline

#10 2016-09-30 00:46:13

S3NTYN3L
Member
From: Blito-P3
Registered: 2015-07-29
Posts: 43

Re: [SOLVED] Hibernate on Lid Close?

Chazza wrote:

Have you seen this section of the article you linked to?

No, I missed that section somehow.

I went ahead and installed the LTS kernel and edited my bootloader accordingly.
Sadly, there is no change in behavior whatsoever.

Perhaps the LTS kernel is too new? (uname -a reports 4.4.22-1-lts #1 SMP Sept 24 17:58:05 CEST 2016 x86_64)

Offline

#11 2016-09-30 02:32:04

S3NTYN3L
Member
From: Blito-P3
Registered: 2015-07-29
Posts: 43

Re: [SOLVED] Hibernate on Lid Close?

I got it working easily via this blog post.


It's a shame this can't be handled by systemd as the wiki proclaims, but oh well, I'm happy nonetheless.



[Solved]

Offline

Board footer

Powered by FluxBB