You are not logged in.
Hello!
I have problems with hibernation after moving to a new computer.
In itself it works. If I use "systemctl hibernate" to shut down the system to hibernate, then after booting everything is restored correctly.
My problem now: the computer does not shut down completely, but restarts again directly.
As described here (https://wiki.archlinux.org/title/Power_ … ibernating), I have written the lines
[Sleep]
HibernateMode=shutdown
in "/etc/systemd/sleep.conf.d/hibernatemode.conf" and restarted, but that also brought no success.
~ $ lsblk -f
nvme0n1
├─nvme0n1p1 ext4 1.0 312342de-aade-48da-bd7c-33f0676f9a3b 603,8G 24% /
└─nvme0n1p2 swap 1 3f9afa91-ceec-4123-8dff-6739420b6d7e [SWAP]
~ $ cat /boot/EFI/refind/refind.conf
menuentry "Arch Linux" {
icon /EFI/refind/themes/refind-minimal/icons/os_arch.png
loader /vmlinuz-linux
initrd /initramfs-linux.img
options "rw root=UUID=312342de-aade-48da-bd7c-33f0676f9a3b resume=UUID=3f9afa91-ceec-4123-8dff-6739420b6d7e add_efi_memmap initrd=/amd-ucode.img nvidia_drm.modeset=1"
submenuentry "Boot using fallback initramfs" {
initrd /initramfs-fallback.img
}
submenuentry "Boot to terminal" {
add_options "systemd.unit=multi-user.target"
}
}
~ $ cat /etc/mkinitcpio.conf
# vim:set ft=sh
# MODULES
# The following modules are loaded before any boot hooks are
# run. Advanced users may wish to specify all system modules
# in this array. For instance:
# MODULES=(piix ide_disk reiserfs)
MODULES=(nvidia nvidia_modeset nvidia_uvm nvidia_drm)
#MODULES=( nouveau )
# BINARIES
# This setting includes any additional binaries a given user may
# wish into the CPIO image. This is run last, so it may be used to
# override the actual binaries included by a given hook
# BINARIES are dependency parsed, so you may safely ignore libraries
BINARIES=()
# FILES
# This setting is similar to BINARIES above, however, files are added
# as-is and are not parsed in any way. This is useful for config files.
FILES=()
# HOOKS
# This is the most important setting in this file. The HOOKS control the
# modules and scripts added to the image, and what happens at boot time.
# Order is important, and it is recommended that you do not change the
# order in which HOOKS are added. Run 'mkinitcpio -H <hook name>' for
# help on a given hook.
# 'base' is _required_ unless you know precisely what you are doing.
# 'udev' is _required_ in order to automatically load modules
# 'filesystems' is _required_ unless you specify your fs modules in MODULES
# Examples:
## This setup specifies all modules in the MODULES setting above.
## No raid, lvm2, or encrypted root is needed.
# HOOKS=(base)
#
## This setup will autodetect all modules for your system and should
## work as a sane default
# HOOKS=(base udev autodetect block filesystems)
#
## This setup will generate a 'full' image which supports most systems.
## No autodetection is done.
# HOOKS=(base udev block filesystems)
#
## This setup assembles a pata mdadm array with an encrypted root FS.
## Note: See 'mkinitcpio -H mdadm' for more information on raid devices.
# HOOKS=(base udev block mdadm encrypt filesystems)
#
## This setup loads an lvm2 volume group on a usb device.
# HOOKS=(base udev block lvm2 filesystems)
#
## NOTE: If you have /usr on a separate partition, you MUST include the
# usr, fsck and shutdown hooks.
HOOKS=(base udev autodetect modconf block filesystems keyboard resume fsck)
# COMPRESSION
# Use this to compress the initramfs image. By default, zstd compression
# is used. Use 'cat' to create an uncompressed image.
#COMPRESSION="zstd"
#COMPRESSION="gzip"
#COMPRESSION="bzip2"
#COMPRESSION="lzma"
#COMPRESSION="xz"
#COMPRESSION="lzop"
#COMPRESSION="lz4"
# COMPRESSION_OPTIONS
# Additional options for the compressor
#COMPRESSION_OPTIONS=()
~ $ cat /sys/power/mem_sleep
s2idle [deep]
~ $ cat /etc/systemd/sleep.conf.d/hibernatemode.conf
[Sleep]
HibernateMode=shutdown
In my BIOS i have the following settings:
ErP Ready Enabled (S4+S5)
Energy Star Ready Enabled
CEC Ready Enabled
Restore AC Power Loss Power Off
Power On By PCI-E Disabled
Power On By RTC Disabled
I have tried to change all of these to "Disabled" but without success.
Last edited by paulbrause (2023-09-12 08:59:29)
Offline
Not sure this is what would cause your problem, but I think you also need a "resume_offset=<bit offset>" in your refind manual stanza "options" line.
Unless the recommendation has changed now, I think loading the "initrd=amd_ucode.img" should be moved to the very last parameter of your options list.
Nothing else shows any red flags to me. I've used almost the exact setup. Start with that, and if it is still acting up, I'll re-implement it on my own machine to see what happens.
By the way, what machine are you using (make, model, firmware)?
also, how big is your swap partition, and how much ram do you have?
Last edited by feinedsquirrel (2023-09-09 20:40:07)
Offline
I actually think as it's a standalone swap partition, the "resume_offset" is not needed - I think that's only for a swapfile.
Presumably nothing here is encrypted based on what you've shown, but FWIW I've never gotten hibernation+luks to play nice with one another.
Offline
Oh, yup, cloverskull is right. I've only ever used a swap file. I apologize for the red herring.
Offline
From the lsblk I assume there's no parallel OS (windows)?
What kind of hardware is this exactly?
Can you "systemctl shutdown" as expected?
Offline
Sorry for this late answer.
With a little help i just found out, what the problem was.
The file /etc/systemd/sleep.conf looked like this:
[Sleep]
AllowHibernation=yes
HibernateMode=reboot
I don't know why these lines are written in there, but after changing to "HibernateMode=shutdown" my PC hibernates and shuts down as expected.
Thanks to all.
Offline