Can you hibernate/reboot in Linux instead of hibernate/poweroff?

7

I'm using pm-hibernate, and would like to reboot the machine after it's done hibernating, rather than having the machine turn off.

Is there a way to do this with pm-hibernate, or any other Linux hibernate thing?

Neil

Posted 2010-04-10T22:49:21.247

Reputation: 4 761

I would think the answer is, probably, yes, but I don't know how. You'll probably you'll probably have to investigate all the steps that make hibernate in the first place and write a script to do it. Because I think this is all basically scripted in the first place. – xenoterracide – 2010-04-11T01:03:59.393

Seven years later, we have UEFI, which makes that quick-OS-change trick all the more attractive (efibootmgr --bootnext $windowsbootid && $hibernatecommand). Shame there's no way to set BootNext from Windows, really. – Darael – 2017-09-26T18:44:42.520

But I just want to know why you want to reboot the system after hibernate. AFAIK, boot up the box after hibernate will bring you to the stats you turned it off. You want to loop it over? Sorry for my poor English. I hope I expressed my idea fully. – Grissiom – 2010-04-12T11:52:37.167

1Dual boot, if you hibernate windows you can reboot quickly into an already hibernated linux. Or the other way around. :) – Algific – 2010-04-12T12:32:44.937

Answers

6

From man pm-hibernate in the "CONFIGURATION VARIABLES" section:

HIBERNATE_MODE
Default method to power down the system when hibernating. If not set, the system will use the kernel default as a default value. Check /sys/power/disk for valid values. The default value will be surrounded by [square brackets].

On my system that file contains:

test testproc [shutdown] reboot

Set the value by placing a file in /etc/pm/config.d/. For example, you could create a file called /etc/pm/config.d/hibernate and in it put the line:

HIBERNATE_MODE=reboot

Paused until further notice.

Posted 2010-04-10T22:49:21.247

Reputation: 86 075