You are not logged in.

#1 2013-08-27 22:34:32

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

[Solved] Suspend to Disk: systemd-hibernate.service Fails

Howdy-ha, folks.  I know this looks pretty mundane, but for the life of me I can't get hibernation to work.  Each time I run systemctl hibernate the screen will go blank as though preparing to suspend, then come back on; journalctl shows the same error messages:

PM: Cannot find swap device, try swapon -a.
PM: Cannot get swap writer
Failed to start Hibernate.
Dependency failed for Hibernate.
Service sleep.target is not needed anymore. Stopping.
Unit systemd-hibernate.service entered failed state.

This happens when swap is mounted, and "swapon" says as much.  I've been working on this for about four hours now, and none of what I've found seems to pertain to my situation (most of the "solutions" were "Increase partition size').

What I've tried:

- Three different kernels---linux-ck custom build and linux-ck-sandybridge from graysky's repo (both with BFQ and CFQ: see below), as well as the stock Arch kernel
- A 2 Gb swap file at /swapfile on my SSD;
- A 4 Gb swap partition on /dev/mmcblk0 (an SD card, and my preferred method/location, if possible);
- An 8 Gb swap partition on HDD /dev/sdb2

Reasons for wanting hibernate rather than suspend-to-RAM:
- Maximize battery life.
- There's some kind of issue with Linux-ck and suspending to RAM; it'll work once, then freeze in a kernel panic the second time, forcing a hard reset.  The stock kernel suspends to RAM, but still won't hibernate
- I put a lot of time into building a custom Linux-ck kernel, and would rather not have to start the configuration over with the stock kernel if possible.

I'm working with limited space on my boot drive and, as mentioned, increasing the amount of swap has no bearing on this.  The resulting phenomenon and error messages are the same, regardless of size and medium.  I've exhausted my ideas on where to look, and what to even look for.  Thanks a lot to everyone in advance (especially you,karol; don't think I don't see you lurking back there wink )

Last edited by ANOKNUSA (2013-11-17 05:32:14)

Offline

#2 2013-08-27 22:42:11

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] Suspend to Disk: systemd-hibernate.service Fails

I haven't used swap or hibernation on quite some time.  But I just issued a systemctl hibernate and I actually only get the

PM: Cannot find swap device, try swapon -a.
PM: Cannot get swap writer

I get nothing about a failure to start hibernate or the thing about a dependency failure.  Maybe this is a clue?  I have no idea, but I just figured I'd point it out since my results are different on a machine with zero swap.

Offline

#3 2013-08-27 23:01:16

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: [Solved] Suspend to Disk: systemd-hibernate.service Fails

Sorry, WonderWoofy; I edited the code block in the first post to clarify.  I should also add that /dev/mmcblk0p1 is in my fstab, and mounts just fine as swap on boot; also, my kernel parameter line isn't in the first post because the machine never even reaches a suspended state, in case anyone is wondering.

Offline

#4 2013-08-27 23:10:00

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: [Solved] Suspend to Disk: systemd-hibernate.service Fails

You aren't meant to mount it at all? What exactly does swapon say?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#5 2013-08-27 23:10:24

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: [Solved] Suspend to Disk: systemd-hibernate.service Fails

I'm not sure how long ago you started attempting this, but my machine stopped being able to suspend to RAM or hibernate when the stock Arch kernel updated to 3.10.9. The last kernel for which it works was 3.10.6 (I think I skipped .7 and .8). Not sure if this is relevant to your issue, but perhaps worth ruling out.

Scott

Offline

#6 2013-08-27 23:41:51

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: [Solved] Suspend to Disk: systemd-hibernate.service Fails

Initially, I get

$swapon
/dev/mmcblk0p1           partition 3.7G   0B    0

After attempting hibernation:

/dev/mmcblk0p1 (deleted) partition 3.7G   0B    0
/dev/mmcblk0p1           partition 3.7G   0B    0

Sorry if I got my terminology mixed up.

EDIT---@firecat: I've seen forum posts by folks with similar StR problems as mine, but nothing about hibernation.  Looking through arch-general-public for the last couple months doesn't reveal anything, either (unless I'm overlooking it);  if this were normal, wouldn't there be more people with the issue?  Incidentally, what machine are you running on?  I've got a Lenovo T520, if that makes any difference.  The hardware is almost exclusively Intel- brand.

Last edited by ANOKNUSA (2013-08-27 23:46:05)

Offline

#7 2013-08-28 00:02:33

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: [Solved] Suspend to Disk: systemd-hibernate.service Fails

Does it ever actually use swap in normal use? That is, do you ever see more than 0B used? Have you tried increasing the system's swappiness temporarily to see if you can get it to use swap?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#8 2013-08-28 00:36:02

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: [Solved] Suspend to Disk: systemd-hibernate.service Fails

I've got swappiness set at 100, while running DWM, Firefox, Vim, one Sass and one Jekyll server, a game on Steam and a VirtualBox VM with 4096 Mb of RAM dedicated to it.  It's taking up ~5.65 Gb of RAM out of 8 total, with no swap at all.  From what I've read (in the last half-hour, anyway), that doesn't seem right, does it?  I'll test it again with the other locations mentioned in the OP, and get back to you.

Offline

#9 2013-08-28 00:38:45

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: [Solved] Suspend to Disk: systemd-hibernate.service Fails

What does free -h give?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#10 2013-08-28 01:03:52

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: [Solved] Suspend to Disk: systemd-hibernate.service Fails

I rebooted, so trying to recreate the same situation:

$ free -h
             total       used       free     shared    buffers     cached
Mem:          7.7G       7.2G       525M         0B        32M       2.3G
-/+ buffers/cache:       4.8G       2.9G
Swap:         3.7G         0B       3.7G

top reports nearly the same thing:

top - 20:00:13 up 22 min,  1 user,  load average: 0.12, 0.22, 0.14
Tasks: 155 total,   1 running, 154 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.1 us,  0.3 sy,  0.1 ni, 99.5 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem:   8061380 total,  7500096 used,   561284 free,    34432 buffers
KiB Swap:  3872236 total,        0 used,  3872236 free,  2417172 cached

htop, however, reports about 1.5 Gb more free RAM.  After reboot, swappiness is still set to 100 with the same results.

EDIT:

ANOKNUSA wrote:

I'll test it again with the other locations mentioned in the OP, and get back to you.

Even though I rebooted, I haven't done this yet, so ignore it for the moment.

Last edited by ANOKNUSA (2013-08-28 01:06:10)

Offline

#11 2013-09-16 15:26:21

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: [Solved] Suspend to Disk: systemd-hibernate.service Fails

@op - You haven't mark this as solved... please try 3.11.1-2 from the repo or built yourself.  Several (5 so far) have reported that it fixes their suspend issues.[1]

1. https://bbs.archlinux.org/viewtopic.php … 8#p1325218

Last edited by graysky (2013-09-16 15:27:53)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#12 2013-09-17 02:12:13

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: [Solved] Suspend to Disk: systemd-hibernate.service Fails

@graysky: I'll take a crack at it later this week (I should have some time on Wednesday).  I am still interested in solving this, but I've been tied up with school these last couple weeks.

Offline

#13 2013-09-17 10:30:31

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,494

Re: [Solved] Suspend to Disk: systemd-hibernate.service Fails

ANOKNUSA wrote:

@graysky: I'll take a crack at it later this week (I should have some time on Wednesday).  I am still interested in solving this, but I've been tied up with school these last couple weeks.

Hi, I don't know if I can be of any assistance after this, but could you try strace, and see if it has any useful output to use, strace helped me solve issues in the past.
Try this oneliner;

 strace -f -s 1500 -o strace.txt systemctl hibernate

See man strace, it traces your process and it's child processes to 1500 lines, strace.txt
You should install strace, which is in [extra] repo.

Offline

#14 2013-09-25 05:38:01

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: [Solved] Suspend to Disk: systemd-hibernate.service Fails

@Graysky: The latest -ck update definitely solves the suspend-to-RAM issue, but hibernate still doesn't seem to work.

@qinohe: I'm sorry, but I don't even know how to begin using that strace output; I'll look at the man page when I can, but time is limited for me at the moment.

Offline

#15 2013-09-25 08:52:50

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,494

Re: [Solved] Suspend to Disk: systemd-hibernate.service Fails

ANOKNUSA wrote:

@qinohe: I'm sorry, but I don't even know how to begin using that strace output; I'll look at the man page when I can, but time is limited for me at the moment.

I.m sorry too, as I don't know of any tricks/tools to do this quicker

Yeah, that still be quite a puzzle to figure out what went wrong once you have that output. I promise you, I too, still find it difficult to use that tool.

You are looking for things like 'error signal..' and SIGABRT etc.  You could dump the output on pastebin, so we can take a look too.

I would also suggest after man strace, you take a look at man (7) signal.

.

Offline

#16 2013-11-17 05:31:53

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: [Solved] Suspend to Disk: systemd-hibernate.service Fails

I realize this topic has been inactive for some time, but following the 3.12 kernel upgrade I decided to give suspend-to-disk another shot.  Everything works fine now, though the swap space in my case does need to be equal to my physical RAM (despite what I'd heard elsewhere).  I still have no idea why it didn't work before; sorry I can't leave more for posterity. I'll mark this as [Solved].

Offline

#17 2013-11-17 05:55:47

progandy
Member
Registered: 2012-05-17
Posts: 5,184

Re: [Solved] Suspend to Disk: systemd-hibernate.service Fails

ANOKNUSA wrote:

Everything works fine now, though the swap space in my case does need to be equal to my physical RAM (despite what I'd heard elsewhere).

As far as I know, only uswsusp can create compressed hibernate images. The kernel just dumps the whole RAM in the swapspace, I think. I'm not totally sure about tuxonice.
Usually I allocate RAM+1GB (minimum 3GB) for my swap partition for the rare case that there is a small amount of used swap space during the hibernation cycle.

Last edited by progandy (2013-11-17 06:00:12)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

Board footer

Powered by FluxBB