I installed Manjaro Gnome a few weeks ago (Fresh install, was a previous Manjaro KDE user), on my Dell XPS 13 laptop. I am having an issue with hibernate not working when reaching a critical low battery.
The Issue:
I’ve noticed that when my laptop battery reaches about 3%, I get a system message saying the system will enter hibernation mode very soon. Oddly, it seems that the computer goes into standby / suspend mode, because I can wake up the computer with the mouse, and does NOT enter hibernate mode. I tested and made sure hibernate works (by running systemctl hibernate) and the computer does hibernate properly without any issues when running the command manually in the terminal.
The Problem:
So, the main issue is the computer enters standby / suspend and not hibernate when the battery reaches 3%. I haven’t done much in terms of custom configurations, and it APPEARS that it should enter hibernate according to the system message that pops up on the screen. What should I do to check if things are setup correctly, and to fix the actual problem and have the computer enter hibernate when the battery reaches 3%?
Any help would be greatly appreciated. Thanks in advance to anyone who can help me figure this out.
It’s always a good idea to post the output of an inxi --admin --verbosity=7 --filter --no-host --width with any question you ask as that gives us more information on your system.
In the future, when providing code/output, please copy-paste that output in-between 3 backticks ``` at the beginning and end of the code/text so that the output looks like this:
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
instead of like this:
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
(as that makes both our lives much easier)
No need to do anything right now as I’m an editor here on this site and have fixed it for you already. However, in the future I might not see your post so review my edits by pushing the orange pencil above the post I just fixed.
output of gsettings list-recursively | grep battery, please?
Kernel: 5.9.16-1-MANJARO is EOL. Please upgrade to 5.4 LTS and / or 5.10 (LTS candidate).
BAT0 charge: 11.5 Wh condition: 33.9/57.5 Wh (59%) volts: 7.4/7.6 : your battery is reaching EOL too. 3% is too low. Once I receive #3 above you’ll be better set it to 10% to avoid catastrophic shutdowns.
Unrelated to your issue (just a preference of mine): Kernel: swappiness: 60 (default) cache pressure: 100 (default): better set those to 90 and 75 respectively.
I used to tun Gnome (on KDE now) and just did those from memory, but I can’t seem to find the right parameter, so I’ve edited your title and added the Gnome tag to attract people who can test this on a current version of Gnome (And why I left Gnome: Functionality that existed before seems to have gone away)
Good! (Any difference? If not: have you tried 5.4 already?)
In a nutshell: Swap later and once swapped out, don’t try to immediately swap in again. Details:
fab-user@fab-manjaro:~
$ cat /etc/sysctl.d/30-swap_usage.conf
# Fabrizio: 2014-03-02: change "swappiness" from default 60 to 10:
# Theoretically, only swap when RAM usage reaches around 80 or 90 percent
# Fabrizio: 2014-03-29: lower to 5 as swapping is still occurring with low mem usage
# Fabrizio: 2014-11-21: Bring back up to 10 as vm.vfs_cache_pressure was introduced
vm.swappiness = 10
# Fabrizio: 2014-11-29: Lower vm.vfs_cache_pressure to 75%
# (once cached, probably not immediately needed any more)
#
# This percentage value controls the tendency of the kernel to reclaim
# the memory which is used for caching of directory and inode objects.
#
# At the default value of vfs_cache_pressure=100 the kernel will attempt to
# reclaim dentries and inodes at a "fair" rate with respect to pagecache and
# swapcache reclaim. Decreasing vfs_cache_pressure causes the kernel to prefer
# to retain dentry and inode caches.
vm.vfs_cache_pressure = 75
Update #1:
I re-ran the hibernate test (under 5.10.x Kernal), it appears that the issue still exists (laptop goes into standby instead of hibernate mode) when the battery is at critical low levels.
Update #2:
I also forgot to add, that I did modify a few configs to enable a power management setting for when I close the laptop lid (and the machine goes into standby, this is expected), I also wanted the machine to go into hibernate after a specific period of time (60-min). Specifically, for the laptop to go into ‘suspend then hibernate’ functionality.
To achieve this, I followed the steps outlined by “PRIHLOP” in the following post here:
By modifying the sleep.conf and the logind.conf config files, I was able to get this working PERFECTLY as expected. However, I mention it because maybe that’s the issue preventing the laptop from going into Hibernate on low-battery, even though the Manjaro System displays a message that it wants to hibernate on low-battery:
If I can provide any additional details to help in the troubleshooting process, please let me know. Thank you in advance to everyone for your time and help, it is greatly appreciated!
I’m confused… Did you add resume in mkinitcpio.conf before or after the grep? or was it there already? (If it was there already, I can’t help you any further as that was the missing bit for someone else…)
I added the ‘resume’ to mkinitcpio.conf a few weeks ago to get hibernate to work. So, when you asked me yesterday to check if it exists, it was already there. =)
Well, I have to wait for my battery to wear down to less than 10% (currently at 90%). So, it’ll take some time to get the battery worn down so I can test the use-case properly. =)
Update:
So, finally hit the magic 3% battery life mark, and got the usual hibernate system message, annnnddd the computer went into STANDBY mode (not hibernate). So, looks like this is still an issue so far.
Not sure what else to try at this point. If anyone else has any suggestions / feedback / thoughts, please let me know.