You are not logged in.

#1 2013-09-23 07:49:11

ypnos
Member
Registered: 2007-12-30
Posts: 58

Suspend to disk does not resume

Hello,

I find the information in the wiki inconsistent across pages and it is unclear which is outdated.
In theory you can suspend to disk by issuing:
# systemctl hibernate

What systemd really does, is in the blue, as everything with systemd. But you can also try to do it directly via
# echo -n "disk" > /sys/power/state

Both work on my system and I can see the hard-drive flashing while the image is written. I also found in the syslog (journalctl) an entry when activating the swap along the lines of "swsusp header found, re-creating swap space".
The problem is that the system never resumes from that data (and then overwrites it when mounting the swap).

I tried two countermeasures:
- add "resume" hook in mkinitcpio before "fsck" (where should it be added actually?)
- add "resume=/dev/sda6" to kernel parameters via GRUB

Journalctl reveals that the kernel is indeed started with said parameter. However I don't find any other trails of "resume" or "suspend" in journalctl.

Does anybody have a running suspend-to-disk solution and what did you change to make it work?

Thanks in advance,
ypnos

Offline

#2 2013-09-23 08:46:58

phw
Member
Registered: 2013-05-27
Posts: 141

Re: Suspend to disk does not resume

I got it to work with just the two changes you mentioned. But you should be aware that just changing the configuration files is not enough. For the mkinitcpio change to take affect you have to rebuild the initramfs image:

mkinitcpio -p linux

The resume hook has to be added to the HOOKS, see https://wiki.archlinux.org/index.php/Su … al_ramdisk

The resume kernel parameter in the GRUB configuration requires you to run the grub-mkconfig command (see https://wiki.archlinux.org/index.php/Su … arameters), but from your comments I assume you already did that. And double check whether /dev/sda6 is indeed the swap partition.

Offline

#3 2013-09-23 09:01:20

mr.MikyMaus
Member
From: +3600 UT
Registered: 2006-03-31
Posts: 270

Re: Suspend to disk does not resume

Could this perhaps be the same or similar problem as I have here?

https://bbs.archlinux.org/viewtopic.php?id=170152


What happened to Arch's KISS? systemd sure is stupid but I must have missed the simple part ...

... and who is general Failure and why is he reading my harddisk?

Offline

#4 2013-09-24 06:13:54

ypnos
Member
Registered: 2007-12-30
Posts: 58

Re: Suspend to disk does not resume

Thank you for the confirmation that it should work as described. Hibernation now works for me too. Yes, I had always rebuilt the initcpio.

The thing I changed was that I placed "resume" before "filesystems" in the HOOKS. From the data I gathered from the log files however I would have assumed this was not the cause of the problem. As the "swapon" message was always after the (previously missed) "Hibernation image not present or could not be loaded." message. So I don't know what the problem really was.

That will unfortunately not help mr.MikyMaus.

Last edited by ypnos (2013-09-24 06:15:39)

Offline

#5 2013-09-28 09:16:37

wombalton
Member
Registered: 2011-07-18
Posts: 17

Re: Suspend to disk does not resume

A shock today: Hibernation is not working any more! It worked perfectly fine the other day, what is happening?
Well simple solution: I was toying around with the new systemd hook. Turns out if you have it in your hookline

 HOOKS="base systemd autodetect ... resume filesystems"

the resume hook is not being respected. So for now I stick to my old one.

 HOOKS="base udev autodetect ... resume filesystems"

P. S. There is already a bug report to my problem: https://bugs.archlinux.org/task/37028

Last edited by wombalton (2013-09-28 09:19:32)

Offline

Board footer

Powered by FluxBB