OpenSuse 13.1: Correct command/sequence for suspend-on-disk?

Hello,
I am using FVWM and need to know how the correct command/script is for hibernating my PC.

I read the pm-utils documentation and searched the web a lot, but I didn’t find an answer to my problem.
When I call hibernate from the KDE kickoff menu, all works fine, as it should do.
But, when I run pm-hibernate from a shell, the running system apparently gets swapped out. But when the system restarts, it does a fresh normal boot, instead of restoring the memory image and continuing the previous session.
Thus I am unsure whether pm-utils in the OpenSuse 13.1 distribution are pre-configured. So my questions:

  1. Are pm-utils in the OpenSuse 13.1 pre-configured, or do I have to configure them before calling pm-hibernate from FVWM can work?

  2. Maybe on OpenSuse doing pm-hibernate alone is not enough? If so, could anybody tell the “official way” to do this on OpenSuse?

I don’t use pm utils but

/usr/sbin/s2disk --help

should do what you want.

This is what i was using before.

/usr/sbin/s2disk -f /etc/suspend.conf

when doing it in a shell but when im in kde, suspend to disk just works.

They are pre-configured, you shouldn’t have to do anything.
Unless you have problems.

  1. Maybe on OpenSuse doing pm-hibernate alone is not enough? If so, could anybody tell the “official way” to do this on OpenSuse?

Try “systemctl hibernate”. But this will just call pm-utils anyway if it is installed (on 13.1 that is, not on 13.2 any more).

If pm-utils give you problems, try to uninstall them. They are only needed for certain workarounds that should not be necessary any more.
And they are deprecated.

Btw, you have to boot the same kernel that you suspended of course. Normally a pm-utils hibernate script should take care of that, but this might not work with every boot loader.

And make sure that you have a correct “resume=xxx” option on your kernel command line.
But if it works with KDE, this should be the case anyway.

Thanks to both Jetchisel and Wolfi!

I first looked at /etc/suspend.conf and there are a lot of options. But after activating some useful settings (checksumming, multicore compression etc), the restart failed.
I got a strange message.about wrong checksum. But the checksums displayed were identical…
Then I followed the advice of Wolfi to use systemctl. Didn’t produce the desired result, so I uninstalled pm-utils as advised. The result was that while/after the loading of the image the system just reboots. When I read through the systemd/systemctl documentation and searching the web, I found a post in the OpenSuse lists saying that behind the scenes OpenSuse uses upower to do the hibernate thing, I searched for the upower documentation, but it is rudimentary only and not really helpful.
Would be really great to know what OpenSuse KDE does when the user commands hibernate, but I didn’t find out anything in this regard yet.

I feel stuck for now. Now going to take a break. Any idea?

No.
KDE uses upower “to do the hibernate thing”.
upower is an abstraction layer, and uses then systemd (which in turn uses either pm-utils or the kernel interfaces directly) in the end to do the hibernation.

Would be really great to know what OpenSuse KDE does when the user commands hibernate, but I didn’t find out anything in this regard yet.

It tells upower to hibernate via dbus.
I.e. something similar to:

qdbus --system org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Hibernate

Does it work if you run that line? Then this would be a way for you to do what you want as well.

I feel stuck for now. Now going to take a break. Any idea?

Do you still have pm-utils installed?
Have a look at /var/log/pm-suspend.log after the resume failed.

Or try to uninstall them as I already suggested.

Some random thought: is your swap space big enough to do the hibernate?
It should be at least as big as your RAM, preferably bigger.
But if that would be the problem, it should not work from KDE either.

On 2014-10-31 10:26, Brotzkocken wrote:
>
> Hello,
> I am using FVWM and need to know how the correct command/script is for
> hibernating my PC.
>
> I read the pm-utils documentation and searched the web a lot, but I
> didn’t find an answer to my problem.
> When I call hibernate from the KDE kickoff menu, all works fine, as it should do.
> But, when I run pm-hibernate from a shell, the running system apparently
> gets swapped out.

pm-hibernate is the correct command, yes. Others are pm-suspend, to suspend to ram, pm-suspend-hybrid, which does both.
You could also try ‘pm-is-supported’ :-?

And up to here what happens is correct.

> But when the system restarts, it does a fresh normal
> boot, instead of restoring the memory image and continuing the previous
> session.

Check the log, “/var/log/messages”. You should see a line similar to this:


<0.7> 2014-10-24 23:30:56 Telcontar kernel - - -     0.938227] PM: Checking hibernation image partition /dev/disk/by-label/b_swap
....
<0.7> 2014-10-24 23:30:56 Telcontar kernel - - -     1.250197] PM: Hibernation image not present or could not be loaded.

  1. Are pm-utils in the OpenSuse 13.1 pre-configured, or do I have to
    configure them before calling pm-hibernate from FVWM can work?

They are configured already, but you can change things. I always do:

/etc/suspend.conf:


splash = n

You could try disabling compression and encryption. Try:

suspend loglevel = 255
splash = n
compress = n
encrypt = n
threads = n

> 2. Maybe on OpenSuse doing pm-hibernate alone is not enough? If so,
> could anybody tell the “official way” to do this on OpenSuse?

I use "pm-hibernate several times a day.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)