No shut down following after hibernation

I have run into a problem that my laptop doesn’t shut down after i run systemctl hibernate. The system seems to hibernate, but that turns blackscreen and stays up (the power button stays lit and the buzzing is still hearable). Only option to turn it off is to hard press powerbutton or to let it be until the battery drains.

I have a swap file with size left to be automaticly set during install of EOS two months ago or so. It used to be 14Gi, but when trying to fix this, I expanded this with swapfile to 34 Gi, but that did not solve the issue.

               total        used        free      shared  buff/cache   available
Mem:            13Gi       3,1Gi       8,9Gi       136Mi       1,9Gi        10Gi
Swap:           34Gi        12Ki        34Gi

I also tried to mess with dracut a bit after searching some help on the web, but still no luck. When running the dracut -f --regenerate-all command, there were errors that files /boot/efi/UUID/version were missing (where version just mentioned another kernel versions than what was already there). So I created those folders but it still says those do not exist or are not accessible, which I don’t know how to fix. (btw the error disappeard after first adding the folders there, but after reboot it appears consistently again).

journalctl -b 1 | grep hibernation provides this output:

bře 25 11:48:39 misa-82jq kernel: PM: hibernation: Registered nosave memory: [mem 0x00000000-0x00000fff]
bře 25 11:48:39 misa-82jq kernel: PM: hibernation: Registered nosave memory: [mem 0x0009f000-0x000bffff]
bře 25 11:48:39 misa-82jq kernel: PM: hibernation: Registered nosave memory: [mem 0x000c0000-0x000fffff]
bře 25 11:48:39 misa-82jq kernel: PM: hibernation: Registered nosave memory: [mem 0x09a00000-0x09dfffff]
bře 25 11:48:39 misa-82jq kernel: PM: hibernation: Registered nosave memory: [mem 0x09f00000-0x09f0efff]
bře 25 11:48:39 misa-82jq kernel: PM: hibernation: Registered nosave memory: [mem 0xb4dd9000-0xb4e18fff]
bře 25 11:48:39 misa-82jq kernel: PM: hibernation: Registered nosave memory: [mem 0xb536e000-0xb536efff]
bře 25 11:48:39 misa-82jq kernel: PM: hibernation: Registered nosave memory: [mem 0xb537b000-0xb537bfff]
bře 25 11:48:39 misa-82jq kernel: PM: hibernation: Registered nosave memory: [mem 0xb5383000-0xb5383fff]
bře 25 11:48:39 misa-82jq kernel: PM: hibernation: Registered nosave memory: [mem 0xb53a9000-0xb53a9fff]
bře 25 11:48:39 misa-82jq kernel: PM: hibernation: Registered nosave memory: [mem 0xb53ba000-0xb53bafff]
bře 25 11:48:39 misa-82jq kernel: PM: hibernation: Registered nosave memory: [mem 0xbab69000-0xbbd68fff]
bře 25 11:48:39 misa-82jq kernel: PM: hibernation: Registered nosave memory: [mem 0xc9f7f000-0xccf7efff]
bře 25 11:48:39 misa-82jq kernel: PM: hibernation: Registered nosave memory: [mem 0xccf7f000-0xcdf7efff]
bře 25 11:48:39 misa-82jq kernel: PM: hibernation: Registered nosave memory: [mem 0xcdf7f000-0xcdffefff]
bře 25 11:48:39 misa-82jq kernel: PM: hibernation: Registered nosave memory: [mem 0xce000000-0xcfffffff]
bře 25 11:48:39 misa-82jq kernel: PM: hibernation: Registered nosave memory: [mem 0xd0000000-0xfebfffff]
bře 25 11:48:39 misa-82jq kernel: PM: hibernation: Registered nosave memory: [mem 0xfec00000-0xfec01fff]
bře 25 11:48:39 misa-82jq kernel: PM: hibernation: Registered nosave memory: [mem 0xfec02000-0xfec0ffff]
bře 25 11:48:39 misa-82jq kernel: PM: hibernation: Registered nosave memory: [mem 0xfec10000-0xfec10fff]
bře 25 11:48:39 misa-82jq kernel: PM: hibernation: Registered nosave memory: [mem 0xfec11000-0xfec1ffff]
bře 25 11:48:39 misa-82jq kernel: PM: hibernation: Registered nosave memory: [mem 0xfec20000-0xfec20fff]
bře 25 11:48:39 misa-82jq kernel: PM: hibernation: Registered nosave memory: [mem 0xfec21000-0xfed7ffff]
bře 25 11:48:39 misa-82jq kernel: PM: hibernation: Registered nosave memory: [mem 0xfed80000-0xfed81fff]
bře 25 11:48:39 misa-82jq kernel: PM: hibernation: Registered nosave memory: [mem 0xfed82000-0xfedfffff]
bře 25 11:48:39 misa-82jq kernel: PM: hibernation: Registered nosave memory: [mem 0xfee00000-0xfee00fff]
bře 25 11:48:39 misa-82jq kernel: PM: hibernation: Registered nosave memory: [mem 0xfee01000-0xffffffff]
bře 25 11:48:45 misa-82jq systemd[1]: Starting Resume from hibernation...
bře 25 11:48:45 misa-82jq systemd[1]: Finished Resume from hibernation.

As I have noticed, the system sometimes resumes from the hibernation (after hard turn off and later turn on of course) and sometimes it just boots like it was defaultly shut down, so no resume from hibernation is happening.

I am now helpless after hours spent trying to fix it. Has anyone experienced same problem?

Lenovo Legion 5 Pro - AMD, Nvidia

What did you try so far?

Be sure to add the resume module, and regenerate the initrds again afterward.

See this post for more details regarding the setup required:


Instead of this, try using the dracut-rebuild script. https://discovery.endeavouros.com/installation/dracut/

I have resume set up already.

Tried the dracut-rebuild, but no luck with that. Maybe the problem is not related to dracut.

There just seems to be something preventing the system from shutting down after hibernating, but I have no idea what it could be.

is there a file named resume.conf in the dracut.conf.d

It is. The contents of /etc/dracut.conf.d/resume.conf:

add_dracutmodules+=" resume "
add_device+=" /dev/sda3 "
resume=/dev/sda3

I can see that my additional swapfile (which I have tried to add to my default swap partition in order to solve my issue) isn’t stated there. I don’t know whether adding it here could sovle the problem.. just to mention.

you may have a look here

Tried it, but didn’t work.

What is: cat /proc/cmdline ?

/proc/cmdline:

BOOT_IMAGE=/boot/vmlinuz-linux-lts root=UUID=1927d146-91c2-46f8-a931-caa224631d43 rw nowatchdog nvme_load=YES resume=UUID=ad0a9421-0bd0-4c59-8f95-48c88bc329fa nvidia_drm.modeset=1 loglevel=3

Is this the UUID of your swap partition?
What is the size of your swap partition?

Also, I would either use a swap partition or swapfile as resume device. Not both. Complicating things make solving the issues more complicated.

More, I don’t think these two lines are needed in resume.conf:

Another question: are you using Grub or systemd-boot?

swapon --status:

NAME      TYPE       SIZE   USED PRIO
/swapfile file        20G 367,6M   -2
/dev/sda3 partition 14,9G     0B   -3

blkid | grep swap:

/dev/sda3: LABEL="swap" UUID="ad0a9421-0bd0-4c59-8f95-48c88bc329fa" TYPE="swap" PARTUUID="c39278fd-ed62-4be6-9a50-7861caf6b7c7"

I originally had only the swap partition… I thought that the problem may be caused by insufficient swap space (although I left it on default size recommended by eos installer). And creating additional swapfile seemed to be faster way of trying to fix it… But didn’t help.

Grub 2.13 as bootloader and from what I see systemd is taking care of the hibernation/sleep/shudown business.

concerning systemd have a look at the ArchWiki here

I haven’t found anything helpful there.

UPDATE:
I already tried updating everything using pacman -Syu, I recreated the swapfile according to archwiki, the swapon -s is now

Filename				Type		Size		Used		Priority
/swapfile                               file		20971516	0		-2
/dev/sda3                               partition	15572208	0		-3

the swap file is present in the /etc/fstab

# <file system>             <mount point>  <type>  <options>  <dump>  <pass>
UUID=7D28-F7A2                            /boot/efi      vfat    fmask=0137,dmask=0027 0 2
UUID=1927d146-91c2-46f8-a931-caa224631d43 /              ext4    noatime    0 1
UUID=ad0a9421-0bd0-4c59-8f95-48c88bc329fa swap           swap    defaults   0 0
tmpfs                                     /tmp           tmpfs   defaults,noatime,mode=1777 0 0
/swapfile none swap defaults 0 0

The contents of /etc/dracut.conf.d/resume.conf is

add_dracutmodules+=" resume "
add_device+=" /dev/sda3 "
resume=/dev/sda3
install_items+=" /usr/lib/systemd/system/systemd-hibernate-resume.service "

The contents of /etc/systemd/sleep.conf is

[Sleep]
#AllowSuspend=yes
#AllowHibernation=yes
#AllowSuspendThenHibernate=yes
#AllowHybridSleep=yes
#SuspendState=mem standby freeze
#HibernateMode=shutdown # <--- Here I tried uncommenting it and hibernating with shutdown / platform shutdown options
#MemorySleepMode=
#HibernateDelaySec=
#HibernateOnACPower=yes
#SuspendEstimationSec=60min

I checked my bios and uefi are all up to date.
I have no issues with hibernation when hibernating from win11 (dualboot).
There is no problem with suspending to RAM.

The hibernation proces in journalctl looks like this:

kvě 04 12:30:59 m-82jq systemd-logind[1715]: The system will hibernate now!
kvě 04 12:30:59 m-82jq NetworkManager[1762]: <info>  [1746354659.8829] manager: sleep: sleep requested (sleeping: no  enabled: yes)
kvě 04 12:30:59 m-82jq NetworkManager[1762]: <info>  [1746354659.8830] device (eno1): state change: unavailable -> unmanaged (reason 'unmanaged-sleeping'>
kvě 04 12:30:59 m-82jq NetworkManager[1762]: <info>  [1746354659.9845] device (p2p-dev-wlan0): state change: disconnected -> unmanaged (reason 'unmanaged>
kvě 04 12:30:59 m-82jq NetworkManager[1762]: <info>  [1746354659.9848] manager: NetworkManager state is now ASLEEP
kvě 04 12:30:59 m-82jq NetworkManager[1762]: <info>  [1746354659.9849] device (wlan0): state change: activated -> deactivating (reason 'sleeping', manage>
kvě 04 12:30:59 m-82jq systemd[1]: Starting Network Manager Script Dispatcher Service...
kvě 04 12:31:00 m-82jq systemd[1]: Started Network Manager Script Dispatcher Service.
kvě 04 12:31:00 m-82jq kernel: wlan0: deauthenticating from 98:25:4a:9c:08:93 by local choice (Reason: 3=DEAUTH_LEAVING)
kvě 04 12:31:00 m-82jq wpa_supplicant[1845]: nl80211: send_event_marker failed: Source based routing not supported
kvě 04 12:31:00 m-82jq wpa_supplicant[1845]: wlan0: CTRL-EVENT-DISCONNECTED bssid=98:25:4a:9c:08:93 reason=3 locally_generated=1
kvě 04 12:31:00 m-82jq wpa_supplicant[1845]: wlan0: CTRL-EVENT-DSCP-POLICY clear_all
kvě 04 12:31:00 m-82jq NetworkManager[1762]: <info>  [1746354660.2728] device (wlan0): supplicant interface state: completed -> disconnected
kvě 04 12:31:00 m-82jq NetworkManager[1762]: <info>  [1746354660.2730] device (wlan0): state change: deactivating -> disconnected (reason 'sleeping', man>
kvě 04 12:31:00 m-82jq avahi-daemon[1707]: Withdrawing address record for fe80::f99f:c65f:13e:292c on wlan0.
kvě 04 12:31:00 m-82jq avahi-daemon[1707]: Leaving mDNS multicast group on interface wlan0.IPv6 with address fe80::f99f:c65f:13e:292c.
kvě 04 12:31:00 m-82jq NetworkManager[1762]: <info>  [1746354660.2733] dhcp4 (wlan0): canceled DHCP transaction
kvě 04 12:31:00 m-82jq avahi-daemon[1707]: Interface wlan0.IPv6 no longer relevant for mDNS.
kvě 04 12:31:00 m-82jq NetworkManager[1762]: <info>  [1746354660.2733] dhcp4 (wlan0): activation: beginning transaction (timeout in 45 seconds)
kvě 04 12:31:00 m-82jq NetworkManager[1762]: <info>  [1746354660.2733] dhcp4 (wlan0): state changed no lease
kvě 04 12:31:00 m-82jq avahi-daemon[1707]: Interface wlan0.IPv4 no longer relevant for mDNS.
kvě 04 12:31:00 m-82jq avahi-daemon[1707]: Leaving mDNS multicast group on interface wlan0.IPv4 with address 192.168.0.238.
kvě 04 12:31:00 m-82jq avahi-daemon[1707]: Withdrawing address record for 192.168.0.238 on wlan0.
kvě 04 12:31:00 m-82jq NetworkManager[1762]: <info>  [1746354660.3105] device (wlan0): set-hw-addr: set MAC address to EE:B8:6C:40:F4:EA (scanning)
kvě 04 12:31:00 m-82jq avahi-daemon[1707]: Joining mDNS multicast group on interface wlan0.IPv4 with address 192.168.0.238.
kvě 04 12:31:00 m-82jq avahi-daemon[1707]: New relevant interface wlan0.IPv4 for mDNS.
kvě 04 12:31:00 m-82jq avahi-daemon[1707]: Registering new address record for 192.168.0.238 on wlan0.IPv4.
kvě 04 12:31:00 m-82jq avahi-daemon[1707]: Withdrawing address record for 192.168.0.238 on wlan0.
kvě 04 12:31:00 m-82jq avahi-daemon[1707]: Leaving mDNS multicast group on interface wlan0.IPv4 with address 192.168.0.238.
kvě 04 12:31:00 m-82jq NetworkManager[1762]: <info>  [1746354660.3105] device (wlan0): set-hw-addr: set MAC address to EE:B8:6C:40:F4:EA (scanning)
kvě 04 12:31:00 m-82jq avahi-daemon[1707]: Joining mDNS multicast group on interface wlan0.IPv4 with address 192.168.0.238.
kvě 04 12:31:00 m-82jq avahi-daemon[1707]: New relevant interface wlan0.IPv4 for mDNS.
kvě 04 12:31:00 m-82jq avahi-daemon[1707]: Registering new address record for 192.168.0.238 on wlan0.IPv4.
kvě 04 12:31:00 m-82jq avahi-daemon[1707]: Withdrawing address record for 192.168.0.238 on wlan0.
kvě 04 12:31:00 m-82jq avahi-daemon[1707]: Leaving mDNS multicast group on interface wlan0.IPv4 with address 192.168.0.238.
kvě 04 12:31:00 m-82jq avahi-daemon[1707]: Interface wlan0.IPv4 no longer relevant for mDNS.
kvě 04 12:31:00 m-82jq systemd[2503]: Starting Xfce configuration service...
kvě 04 12:31:00 m-82jq NetworkManager[1762]: <info>  [1746354660.4159] device (wlan0): state change: disconnected -> unmanaged (reason 'unmanaged-sleepin>
kvě 04 12:31:00 m-82jq systemd[2503]: Started Xfce configuration service.
kvě 04 12:31:00 m-82jq NetworkManager[1762]: <info>  [1746354660.5831] device (wlan0): set-hw-addr: reset MAC address to 64:BC:58:A2:6E:3A (unmanage)
kvě 04 12:31:00 m-82jq wpa_supplicant[1845]: p2p-dev-wlan0: CTRL-EVENT-DSCP-POLICY clear_all
kvě 04 12:31:00 m-82jq wpa_supplicant[1845]: p2p-dev-wlan0: CTRL-EVENT-DSCP-POLICY clear_all
kvě 04 12:31:00 m-82jq wpa_supplicant[1845]: nl80211: deinit ifname=p2p-dev-wlan0 disabled_11b_rates=0
kvě 04 12:31:00 m-82jq systemd[1]: Reached target Sleep.
kvě 04 12:31:00 m-82jq systemd[1]: Starting NVIDIA system hibernate actions...
kvě 04 12:31:00 m-82jq hibernate[3977]: nvidia-hibernate.service
kvě 04 12:31:00 m-82jq logger[3977]: <13>May  4 12:31:00 hibernate: nvidia-hibernate.service
kvě 04 12:31:00 m-82jq wpa_supplicant[1845]: wlan0: CTRL-EVENT-DSCP-POLICY clear_all
kvě 04 12:31:00 m-82jq wpa_supplicant[1845]: wlan0: CTRL-EVENT-DSCP-POLICY clear_all
kvě 04 12:31:00 m-82jq wpa_supplicant[1845]: nl80211: deinit ifname=wlan0 disabled_11b_rates=0
kvě 04 12:31:02 m-82jq systemd[1]: nvidia-hibernate.service: Deactivated successfully.
kvě 04 12:31:02 m-82jq systemd[1]: Finished NVIDIA system hibernate actions.
kvě 04 12:31:02 m-82jq systemd[1]: Starting System Hibernate...
kvě 04 12:31:02 m-82jq systemd-sleep[3990]: User sessions remain unfrozen on explicit request ($SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=0).
kvě 04 12:31:02 m-82jq systemd-sleep[3990]: This is not recommended, and might result in unexpected behavior, particularly
kvě 04 12:31:02 m-82jq systemd-sleep[3990]: in suspend-then-hibernate operations or setups with encrypted home directories.
kvě 04 12:31:02 m-82jq systemd-sleep[3990]: Performing sleep operation 'hibernate'...
kvě 04 12:31:02 m-82jq kernel: PM: hibernation: hibernation entry

As from what I have read, there should be lines

PM: Image successfully written, shutting down
ACPI: Preparing to power off...

but it is missing, which relates to the problem of the laptop not fully shutting down, until hard shut down with power button.

Having the laptop plugged or unplugged makes no difference. Swiching envycontrol modes makes also no difference.

I don’t know what else should I try. Does anyone have any solution to this?

if swap file you need to set also file offset in cmdline https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Acquire_swap_file_offset

I currently have a swap partition (size of which was defaultly setup by calamares installer and should be sufficient enough for my RAM). To solve my problem, I have tried to add a swapfile (to make really sure there is enough space). The UUID mentioned in the /proc/cmdline

is UUID of the parition swap, which doesn’t need resume_offset, right?. I suppose I should append the resume=UUID=UUID_OF_THE_SWAPFILE followed by the resume_offset=OFFSET_OF_THE_SWAPFILE.
Is that right? I haven’t found the correct way for the combination of swap partition and swapfile.

Another question is, am I supposed to append the same to the /etc/default/grub file? See last line of cat /etc/default/grub | head -n 6

# GRUB boot loader configuration

GRUB_DEFAULT="0"
GRUB_TIMEOUT="5"
GRUB_DISTRIBUTOR="EndeavourOS"
GRUB_CMDLINE_LINUX_DEFAULT="nowatchdog nvme_load=YES resume=UUID=ad0a9421-0bd0-4c59-8f95-48c88bc329fa nvidia_drm.modeset=1 loglevel=3"

i have no clue if both swaps will be used .. but a swapfile has no uuid it gots located by the UUID of partition it is nesting on and the offset is the place on the partition .

There is another problem. I am trying to change the content inside /proc/cmdline, which is read-only, co I followed the instructions using mounting method described here: https://wiki.archlinux.org/title/Kernel_parameters#Hijacking_cmdline

The file although seems to be rewritten to it’s original form on each reboot.
So I tried to also edit the GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub and ran
grub-mkconfig -o /boot/efi/EFI/endeavouros/grub.cfg .
Then I rebooted and the /proc/cmdline with kernel parameters stays in it’s original form, although GRUB_CMDLINE_LINUX_DEFAULT is edited as desired. So there seems to be no entanglement between these two working. Modifying the kernel parameters inside grub customizer app also doesn’t make any change.

Btw. I don’t know if this relates to the problem, but swapon -s returns both the swap partition and swapfile, but swapon -a returns nothing.

And anyway I don’t think there is a problem with the swap partition… The laptop hibernates succesfully, and there is no problem with swap mentioned in journalctl. The issue is it won’t shut down after hibernation by itself. I think this doesn’t relate to the swap stuff. Can you address more of that side if possible?

hmmm.. could be readomly by reason? we do not set configs under /proc we do under /etc …

may go read the manual before doing stuff ?

i mean you can write a grub.cfg where ever you want but grub needs it in its path as long as you do not change that..

grub-mkconfig -o /boot/grub/grub.cfg