3

I have seen many questions regarding computers that reboot after suspend or hibenation, but always as an undesired behaviour. Now, what I want is to make my computer do exactly that.

I have been multibooting windows and linux (and a few other) for a long time, and althuogh most people would advise against it, I like to hibernate one operating system and reboot into the other (eventually previously hibernated). I know what I'm doing, and with proper care never suffered filesystem corruption.

I can set the next os to boot, to avoid going through the boot menu*, but still have to wait for the system to hibernate, in order to press the power button to turn it on again. On hardware that does not provide any feedback as to the power state (no lights or fan noise during hibernation), I have to wait some extra time, to make sure the system has finished writing the hibernation image and truly shutdown.

It would be much nicer if I could tell the system to reboot immediately after hibernation. Is that possible to achieve in a generic way on modern uefi systems? Or does the behaviour reported in those other posts always result from malfunctioning hardware/drivers?

My use case is:

I am doing some work under Win8, have lots of documents open, and suddenly need to use linux, because windows sucks. Or I feel the urge to play AngryBirds in RemixOS... I'd like to just click a shortcut and wait a few seconds, and my system boots the desired OS, in the state I last left it. After I'm done with that, do the same and I get back to my previous state on windows.

  • I have not really implemented that, but should be feasible using either uefi or grub
  • Why can't you just restart into the other OS? Why do you have to mess with hibernation at all? – Insane Mar 26 '16 at 16:55
  • 1
    Well, I guess it's for the same reason I or anyone woul hibernate instead of shutting down, regardless of multi-boot... to preserve my current work and allow me to go back to what I was doing, and also for getting back to it faster (although with SSD the cold boot is pretty fast). Yes, I could just use virtualization instead of multi-boot; a linux virtualized machine runs pretty well under windows. But it means I don't have the full resources of my machine avilable for the guest - and I have a limited amount of RAM. My use case is: – Ghaspias Mar 26 '16 at 17:01
  • I'm not familiar with hibernate enough to know if what you want could even work. Hibernate then boot into another OS and bring back your main OS out of hibernate. I feel like when switching to the other OS the hibernated OS would just shut down. I'm interested in finding out – Insane Mar 26 '16 at 17:03
  • 2
    I can tell you it works perfectly, as long as both systems don't use the same partition for hibernation file. Windows uses a file hyberfile.sys in c:, linux uses the swap partition. Of course, you should never try to access the file system on the hibernated OS... Linux prevents you from mounting the windows system partition, but not some other partition you might have access from windows! – Ghaspias Mar 26 '16 at 17:15
  • Huh. Interesting – Insane Mar 26 '16 at 17:18
2

In Windows its a definite no. The hibernation process sends the ACPI shutdown signal once the process is finished, thereby shutting down the machine. Linux would be the same way, however it would be modifiable in the source code.

UEFI, as far as I know, has no way of intercepting and changing ACPI signals.

| improve this answer | |
  • I suspected the same. But in old time, there were mechanisms for waking up the system at a given time, through the BIOS. Is it possible that UEFI provides some similar mechanism? Alternatively, would it be possible to "manually" write the hybernation file via some kernel call, and then reboot? – Ghaspias Mar 26 '16 at 17:20
  • 1
    It is possible to wake computer when it is in sleep mode. Hibernation is a state when computer is totally turned off, thus impossible to wake. – Alexiy Mar 26 '16 at 19:41
  • @Alexiy is correct. The OS can wake a computer from sleep/suspended states, but not if the power is off. There are some BIOSs that can turn a computer on from a powered off state. These are there as a safety mechanism if power is lost. When the power comes back the BIOS will turn the machine back on if you set that option. Very useful if it is a remote machine and no one is there to physically power on the machine. I have also seen a few BIOSs that let you schedule on/off times, but those are rare and not very customizable. – Keltari Mar 28 '16 at 15:38
  • I just want to add that in my current laptop, I can get it to reboot after hibernation, by pressing some keys before it finishes writing the hibernation file. It will then reboot instead of shutting down. So it might be possible after all... – Ghaspias May 15 at 4:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.