Skip to main content
Topic: System doesn't wake up from hibernation (Read 268 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

System doesn't wake up from hibernation

As the title says. When the computer goes into hibernation, I have to power it down to use it again.

From looking into it, I suspect the problem is that the system tries to suspend to the SWAP partition, which my basic installation of Artix (OpenRC installed with the graphical installer, I don't remember changing anything during the setup process) has neither a SWAP partition nor file:
Code: [Select]
$ free -h
               total        used        free      shared  buff/cache   available
Mem:            31Gi       3,7Gi        26Gi       100Mi       2,0Gi        27Gi
Swap:             0B          0B          0B

$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda      8:0    0 931,5G  0 disk
└─sda1   8:1    0 931,5G  0 part /media/shared
sdb      8:16   0 953,9G  0 disk
├─sdb1   8:17   0   300M  0 part /boot/efi
└─sdb2   8:18   0 953,6G  0 part /
sdc      8:32   0 953,9G  0 disk
├─sdc1   8:33   0   100M  0 part
├─sdc2   8:34   0    16M  0 part
├─sdc3   8:35   0 953,1G  0 part
└─sdc4   8:36   0   712M  0 part
I am seeing the same error as here on system startup
Code: [Select]
ERROR: resume: no device specified for hibernation
From what I understand I would normally specify my SWAP partition to use and regenerate GRUB config, but I do not have a partition to give GRUB.

I have followed a bunch of other Artix forum posts (in particular, this one), my /etc/elogind/sleep.conf is as follows:
Code: [Select]
[Sleep]
AllowSuspend=yes
AllowHibernation=yes
AllowSuspendThenHibernate=yes
AllowHybridSleep=yes
AllowPowerOffInterrupts=no
AllowSuspendInterrupts=no
SuspendState=mem standby freeze
SuspendMode=suspend
HibernateState=disk
HibernateMode=platform shutdown
HybridSleepState=disk
HybridSleepMode=suspend platform shutdown
HibernateDelaySec=10800
I also added resume to my /etc/mkinitcpio.conf:
Code: [Select]
HOOKS="base udev autodetect modconf block keyboard keymap consolefont filesystems resume fsck"
and ran mkinitspio -p linux, but the problem persists.

How do I set up hibernation without SWAP? In one forum post, someone suggested disabling hibernation entirely, which would be fine by me–I'm just worried about the computer power consumption and noise and "shallow" sleep will help with that–but I don't know how, and the forum post in question didn't specify that.

Re: System doesn't wake up from hibernation

Reply #1
You need something like this in /boot/grub/grub.cfg:
Code: [Select]
resume=UUID=ff972c96-f909-3322-aba4-80c1f99dd605 resume_offset=371488656"
UUID is the partition's where the swapfile resides (blkid) and offset the value given by
Code: [Select]
# filefrag -v /path/to/swapfile | awk '$1=="0:" {print substr($4, 1, length($4)-2)}'
You can of course use LABEL instead of UUID or just the partition's device name (e.g. /dev/sda2). See https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate for more details. You may also need to shift the resume hook to the left, after udev.

Re: System doesn't wake up from hibernation

Reply #2
After reading the Arch wiki page more carefully, hibernation does require having a swap partition or file, and I don't want to bother setting up swap so I'll try disabling hibernation with elogind
Code: [Select]
[Sleep]
AllowSuspend=yes
AllowHibernation=no
AllowSuspendThenHibernate=no
AllowHybridSleep=yes
...
I also shifted the hook as suggested. I'll see if that works a bit later

Re: System doesn't wake up from hibernation

Reply #3
Or with the nohibernate kernel parameter if one doesn't use elogind.
There is this legacy piece of software called TuxOnIce, not maintained anymore so probably works just in old kernels, it hibernated like windows to an arbitrary file, with no swap. This kind of becomes useful now as there are systems out there just with zram/zswap and no actual disk swap.

 

Re: System doesn't wake up from hibernation

Reply #4
Sorry for the delay between posts, this is annoying but not system-breaking.

The above changes I made to the elogind configs have not helped, the system still locks up and seems to still go into hibernation even though I think I disabled it, since I'm still seeing the "no hibernation device" error. I also tried setting HibernateState to mem instead of disk, thinking that would make it suspend to RAM but still, no luck. Why is the system even hibernating in the first place? You guys have any other suggestions?