Skip to content

Instantly share code, notes, and snippets.

@Oliph
Oliph / README.md
Created February 18, 2019 19:47 — forked from setzer22/README.md
Linux command to hibernate and then reboot into a different OS

Linux command to hibernate and then reboot into a different OS

In this document I describe my setup about how to add a menu shortcut that will hibernate and reboot the system into a different OS (in my case, Windows), and then restore linux on the next reboot.

For this, I'll be using Arch Linux with systemd-boot as my boot manager, but in practice any bootloader that handles the LoaderEntryOneShot (a.k.a. BootNext) efivar should work.

NOTE It is advisable to not do this with window's fast boot feature active, since alternating the hibernation of two systems can cause shared partitions to get corrupted. However, if additional steps are taken in order to ensure the shared partition are unmounted before reboot, or no partitions are shared between the two OSs, this can be made to work with fastboot enabled which should give quite a boost in Windows' startup time.

Set the LoaderEntryOneShot/BootNext EFI variable