My laptop stops working if I suspend it by closing the lid

sudo nano /etc/systemd/system/systemd-hibernate.service.d/override.conf
add:

[Service]
Environment=SYSTEMD_BYPASS_HIBERNATION_MEMORY_CHECK=1

save file and reboot then try again…
I can hibernate suspend on my system without any special configuration aside from adding the two things to my grub… but i have 32Gb RAM so supend is not the problem at all, and my swapfile is 8GB, but it could be in your case also that swap is in use already before hibernating and so space is to small?

Hmm it says I cannot save because there is no such file or directory, I thought it would just write it

I’ll try mkdir

Ok @joekamprad this time it behaved differently.

I closed the lid and opened it, and it was a black screen with some yellow text in the top left but went too fast to read.

The screen is black but fan is running. I am unable to resume.

I am sorry to be a pain

you have the pain i do learn on helping you :wink:
To make clear:
Hibernating will write to swap/swapfile and then power off system completely, suspend will suspending system to RAM but leaves system running in low power mode.

1 Like

you should try making the swapfile bigger, may system needs more space for hibernating.

Ok thanks. So currently it is 8gb, twice the amount of RAM I have, how much bigger should I go you feel?

I have some space to spare, but my drive is only quite small, as it is a solid state drive

to be true i do not know how much it needs at minimum to work…
but I would go for 16GB simply to see if it works, you can take also 10GB or 9GB one benefit of swapfile is that you can change the size easy…

Ok thanks, so I will do this:

sudo swapoff /swapfile
sudo rm -f /swapfile
sudo dd if=/dev/zero of=/swapfile bs=1M count=16000 status=progress
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

Is there anyhting I need to do after this with grub? Will the offset be the same?

the offset should be the same, but not 100% sure… better check it after it you need to rebuild grub.cfg as I mentioned before…2021-03-14_00-37
the first one with the two dots behind is the one…

I have posted this up before, if you’re looking to setup hibernate with a swapfile, I use this to follow along because I’m an Arch idiot and can’t remember shit (or I’m probably drinking).

Also. . . since I’m too lazy to even bother doing that anymore, when I setup a system, I just use https://aur.archlinux.org/packages/?O=0&K=hibernator and install it, and I have hibernation setup in like 15 seconds.

I hope it helps!

**Cheers

Thanks

 neil@neil-hppavilionlaptop15cw0xxx  ~  cat /etc/systemd/logind.conf
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See logind.conf(5) for details.

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#UserStopDelaySec=10
#HandlePowerKey=poweroff
HandleSuspendKey=ignore
HandleHibernateKey=ignore
HandleLidSwitch=ignore
#HandleLidSwitchExternalPower=suspend
#HandleLidSwitchDocked=ignore
#HandleRebootKey=reboot
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#RebootKeyIgnoreInhibited=no
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RuntimeDirectoryInodes=400k
#RemoveIPC=yes
#InhibitorsMax=8192
#SessionsMax=8192

Do I need to change this?

I did

HandleLidSwitch=hibernate

still nothing

I don’t know if this makes a difference or not - @joekamprad ?? But I’ve always used

sudo mkinitcpio -p linux

Lowercase -p and then whatever your respective kernel is so mine would be sudo mkinitcpio -p linux-lts for instance. I don’t know the upper from lowercase what the difference would make.

You followed the guide I posted exactly as it says? It should work, I’ve done it many dozens of times now. You can make a change there I believe (although I’ve never done it) after setting up hibernate, I have just used the system power settings. It’s especially easy although I may have missed what DE you have. Plasma it’s right in battery/power management. I can’t recall for others any longer.

and to say someting on top… there are devices simple not supporting powermanagement under Linux at all, or need some drivers activated / kernel parameters set e.t.c.

So what is the Manufacturer Model of the Laptop?

@joekamprad sorry I was stuck in 24 hour shift at work.

I have a HP Pavilion model 15-cw0010na

can you check Bios/Firmware version?
F.46 Rev.A is the latest

I’m on f.42 released 2019. I did not know bios needed firmware updates

So how to update

Oh no it looks like they only support windows for the download
;/

that’s a thing… can be a little challenge to install it without windows installed…
HP makes it not easy … but is possible… i can have a look but not today :wink:

Ok thanks. Yeah I’ve looked around and it seems like there are a lot of warnings that I may brick the laptop.

Shame HP refuse to support Linux. NExt I may look into a laptop that does

yes i do some research and it seems to be the only secure way to install windows for updating Bios/Firmware…
I do also see nothing related on the latest Bios update file that indicates something updated related to poweroptions… it says only “security fixes”
It can be that you need a kernel option to run on boot, but i still not find any possible ones…