Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Two ways to hibernate

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
porton
Posts: 18
Joined: 2013-05-01 23:09

Two ways to hibernate

#1 Post by porton »

The `sudo hibernate` command causes my PC to hang.

But in Gnome "Unlock Screen" dialog there is a hibernate button and this one does work.

How to use this hibernate functionality without locking the screen first?

User avatar
orythem27
Posts: 252
Joined: 2017-05-11 07:59
Location: P.R. China

Re: Two ways to hibernate

#2 Post by orythem27 »

Try `systemctl hibernate` or `pm-hibernate` from the pm-utils package.

As for auto-locking before hibernation, look in to your desktop environment power manager settings to see if there is any related options.

porton
Posts: 18
Joined: 2013-05-01 23:09

Re: Two ways to hibernate

#3 Post by porton »

Neither `systemctl hibernate` nor `pm-hibernate` work:

The computer remains on. After forced reboot it starts a regular system boot, not awakening after hibernate.

User avatar
orythem27
Posts: 252
Joined: 2017-05-11 07:59
Location: P.R. China

Re: Two ways to hibernate

#4 Post by orythem27 »

What about

Code: Select all

echo "disk" > /sys/power/state
Run this command as root.

porton
Posts: 18
Joined: 2013-05-01 23:09

Re: Two ways to hibernate

#5 Post by porton »

`echo "disk" > /sys/power/state` caused the monitor but not the computer itself to turn off. After forced reboot there was a normal boot not awakening from hibernation.

User avatar
pylkko
Posts: 1802
Joined: 2014-11-06 19:02

Re: Two ways to hibernate

#6 Post by pylkko »

it's possible that Gnome is not using hibernate, but rather suspend. If

Code: Select all

sudo systemctl suspend
works then there maybe is something preventing hibernation. Do you have enough swap?

porton
Posts: 18
Joined: 2013-05-01 23:09

Re: Two ways to hibernate

#7 Post by porton »

Thank you pylkko: `sudo systemctl suspend` does work.

porton
Posts: 18
Joined: 2013-05-01 23:09

Re: Two ways to hibernate

#8 Post by porton »

Hm, it seems that I have enough swap to hibernate.

I wonder, why suspend does work, but hibernate doesn't.

Earlier I thought that the problem is with support of my video card, but as suspend works, it seems that the problem is in something other.

User avatar
pylkko
Posts: 1802
Joined: 2014-11-06 19:02

Re: Two ways to hibernate

#9 Post by pylkko »

Because suspend makes a compressed image of the system and stores it in RAM whereas hibernation does the same but stores it on the disk. The most likely reason that it is failing (as of now, given that you give so little information of the system) is that you have misconfigured the swap/disk somehow. But there could be other reasons. You should provide any information of the system and any error messages in logs.

porton
Posts: 18
Joined: 2013-05-01 23:09

Re: Two ways to hibernate

#10 Post by porton »

Currently:

Code: Select all

$ free
              total        used        free      shared  buff/cache   available
Mem:        4122592     1121944     1689924       94104     1310724     2517404
Swap:       3927888           0     3927888

User avatar
orythem27
Posts: 252
Joined: 2017-05-11 07:59
Location: P.R. China

Re: Two ways to hibernate

#11 Post by orythem27 »

porton wrote:But in Gnome "Unlock Screen" dialog there is a hibernate button and this one does work.
Are you sure this button does function as hibernate-to-disk, not suspend-to-RAM?

Also with pm-hibernate you can look into /var/log/pm-suspend.log (pm-hibernate.log?) for traces of error.

porton
Posts: 18
Joined: 2013-05-01 23:09

Re: Two ways to hibernate

#12 Post by porton »

Are you sure this button does function as hibernate-to-disk, not suspend-to-RAM?
I think, this button does suspend to RAM.

Post Reply