You are not logged in.

#1 2012-09-12 16:43:46

xorgx3
Member
From: Poland
Registered: 2011-11-29
Posts: 197

Hibernate and suspend only with systemd

Hi
I want hibernate and suspend my system with systemd( systemctl hibernate and  systemctl suspend). Suspend looks like work correctly, but hibernate isn't wokring.

I've added resume to my hooks in mkinitcpio.

I don't know where are any configuration files for this task, I never found it.

I would be grateful if someone wants help me configured this hibernation.

Offline

#2 2012-09-12 18:03:37

quasifilmie
Member
From: Bowmanville, Ontario, Canada
Registered: 2011-10-27
Posts: 293

Re: Hibernate and suspend only with systemd

Do you have resume in your kernel line? It should be like this resume= (path to your swap such as /dev/sda2). This stuff is in the wiki by the way.

Last edited by quasifilmie (2012-09-12 18:04:00)

Offline

#3 2012-09-12 18:32:28

xorgx3
Member
From: Poland
Registered: 2011-11-29
Posts: 197

Re: Hibernate and suspend only with systemd

Yes, i have resume in my /etc/mkinitcpio.conf, but it didn't work with my path to swap(only resume working).

And is possibility to modify hibernate options?

Offline

#4 2012-09-12 18:57:25

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 812

Re: Hibernate and suspend only with systemd

You should have resume in HOOKS array in mkinitcpio.conf, and resume=/partition/to/resume (/dev/sda*) in your bootloader conf file.

Offline

#5 2012-09-12 19:40:47

xorgx3
Member
From: Poland
Registered: 2011-11-29
Posts: 197

Re: Hibernate and suspend only with systemd

Ok, it works now.  Thanks.

But it still hibernate to swap partition? Can I change this partition to another?


Another question is: where is suspend? RAM or SWAP?

Offline

#6 2012-09-12 21:36:24

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: Hibernate and suspend only with systemd

You can make it hibernate to a swap file. https://wiki.archlinux.org/index.php/Ma … bernate.29

Suspension leaves the RAM on and powers off the rest, hibernation writes the contents of RAM to the disk (swap partition or swap file) and powers off everything.

Last edited by lucke (2012-09-12 21:37:12)

Offline

#7 2012-09-15 16:27:28

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Hibernate and suspend only with systemd

lucke, that section is not about systemd hibernation, as per the OP's original question.

Offline

#8 2012-09-15 18:51:31

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: Hibernate and suspend only with systemd

The OP asked if they could hibernate to a partition other than a swap partition. That sections explains how to make the regular (as opposed to uswsusp or tuxonice) hibernation work with a swap file. That way of hibernation can be triggered by systemd's "systemctl hibernate", pm-utils' "pm-hibernate" (with pm-utils set to use the regular hibernation) or "echo disk > /sys/power/state".

Offline

#9 2012-09-15 19:12:09

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Hibernate and suspend only with systemd

OK, apologies if I misunderstood you.

In that case, do you know how to make "systemctl hibernate" work with a swap file? I've tried it here, and it failed - the error message is

PM: Swap header not found!

Offline

#10 2012-09-15 19:19:46

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: Hibernate and suspend only with systemd

Did you follow that wiki section and set the offset in the kernel line?

Offline

#11 2012-09-15 19:21:51

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Hibernate and suspend only with systemd

Correct me if I'm wrong, but that's a resume parameter - how does that help me if I can't hibernate in the first place?

Offline

#12 2012-09-15 19:27:42

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: Hibernate and suspend only with systemd

I shall readily correct you, for you are wrong! That resume/resume_offset points to where to put (and find) the hibernation image. Please note that in case of a swap file resume= points to the partition holding the swap file.

Offline

#13 2012-09-15 23:30:51

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Hibernate and suspend only with systemd

So happy to be corrected smile

Thanks, lucke, works perfectly now.

Offline

#14 2012-09-16 00:52:24

bwat47
Member
Registered: 2009-10-07
Posts: 637

Re: Hibernate and suspend only with systemd

tomk wrote:

lucke, that section is not about systemd hibernation, as per the OP's original question.

Configuring systemd hibernate is no different. You need the resume hook and to specify a resume partition or file. That's all I did and it hibernates fine with systemctl hiberante.

Last edited by bwat47 (2012-09-16 00:53:22)

Offline

#15 2012-11-12 13:39:49

dionisos
Member
Registered: 2012-01-28
Posts: 8

Re: Hibernate and suspend only with systemd

Hi, i have the same issue.
In my mkinitcpio.conf i have:
HOOKS="base udev autodetect pata scsi sata resume filesystems usbinput fsck"

and in menu.lst i have:
kernel /vmlinuz-linux root=/dev/sda3 ro radeon.audio=1 init=/usr/lib/systemd/systemd resume=/dev/sda5 (where sda5 is my swap partition)

And when i do "systemctl hibernate", that tell me: "swap header not found"

Offline

#16 2012-11-12 19:20:42

root
Member
From: 127.0.0.1
Registered: 2012-04-13
Posts: 297

Re: Hibernate and suspend only with systemd

@dionisos

If you check out the link provided by lucke in #6 you will notice that the resume info must be included before the ro part. Change it and check again.


\(o_X)/
                        'Cause I wanna be an Archy - An Archy in the UK // Sex Pistols

Offline

#17 2012-11-13 06:47:18

dionisos
Member
Registered: 2012-01-28
Posts: 8

Re: Hibernate and suspend only with systemd

Thanks root.
I try to change the order, but that doesn’t change anything.
I have also a: "[drm] nouveau 0000:01:00.0: 0x7374: i2c rd fail: -6" message. (don’t know if there may be a link).

Offline

#18 2012-11-13 06:49:18

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Hibernate and suspend only with systemd

dionisos wrote:

when i do "systemctl hibernate", that tell me: "swap header not found"

Are you sure your swap is setup correctly?

Offline

#19 2012-11-13 15:26:03

dionisos
Member
Registered: 2012-01-28
Posts: 8

Re: Hibernate and suspend only with systemd

I think, and i can hibernate with uswsusp (i find that strange because i change uresume for resume in the hook list)

more /proc/swaps
Filename                Type        Size    Used    Priority
/swapfile                               file        2097148    0    10
/dev/sda5                               partition    3903756    0    100

do I have something to configure for the swap ?

Offline

#20 2012-11-13 16:19:27

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: Hibernate and suspend only with systemd

Try "swapoff /swapfile" before hibernating.

See if "cat /proc/cmdline" shows resume=/dev/sda5.

Last edited by lucke (2012-11-13 16:21:14)

Offline

#21 2012-11-13 17:34:17

dionisos
Member
Registered: 2012-01-28
Posts: 8

Re: Hibernate and suspend only with systemd

I do swapoff/swapon, and then my computer shutdown but don’t resume when it turn on.

Then i do a "mkinitcpio -p linux", and then the resume work.(i read somewhere that i don’t have to)

And after one reboot everything seems to work.

Thanks !!

Offline

Board footer

Powered by FluxBB