How can I manually boot Windows from the Grub2 terminal?

21,213

In grub2 run the following commands one at a time

insmod ntfs
set root=(hdX,gptX)
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
boot

Where hdX is the hard drive Windows is on (hd0 is the first drive) and gptX is the partition number of the Windows EFI partition, so if Windows was the very first partition on the first drive set root=(hd0,gpt0).

Source

Share:
21,213

Related videos on Youtube

Alex Meuer
Author by

Alex Meuer

Updated on September 18, 2022

Comments

  • Alex Meuer
    Alex Meuer over 1 year

    I have both Windows 10 and Ubuntu Desktop on separate partitions on a gpt disk. Windows is trying to reboot to finish off its update but it's causing me to be presented with the grub terminal prompt. I know i can boot ubuntu manually via linux vmlinuz-..., initrd init..., boot commands, but I can't figure out how to do similar for Windows.

    • oldfred
      oldfred over 7 years
      Grub only boots working Windows, so you maybe cannot. Standard Windows entry otherwise would work. Is Ubuntu in UEFI boot mode. UEFI & BIOS are not compatible and once you start booting in one mode, you cannot switch. But you should be able to directly boot Windows from UEFI 's one time boot key often f10 or f12, check your manual. You may need to cold boot, to have time to press a key.
    • mook765
      mook765 over 7 years
      Boot from live-USB and check if your Ubuntu-partition still exists.
    • Alex Meuer
      Alex Meuer over 7 years
      Tried chainloader: "not a valid filename" . Going to back up and reinstall everything.
    • Mark Kirby
      Mark Kirby over 7 years
      Please see my new answer.
  • WinEunuuchs2Unix
    WinEunuuchs2Unix over 7 years
    Not at my computer but I think I had to use 'chainloader +1'. That was legacy mode though with Windows as first partition following grub. This may or may not be helpful here.
  • Mark Kirby
    Mark Kirby over 7 years
    @WinEunuuchs2Unix You are right, on legacy grub it would be chainload (hd0,0)+1 IDK if it is valid for grub2 though, once OP gets back on this, we can see about some adjustments :)