64

I have Windows 10 HOME installed on my system. After I installed Windows 10 HOME, I installed Ubuntu 14.04 LTS on a separate partition so that I could dual boot.

I removed Ubuntu 14.04 LTS by deleting the partition it was installed on. Now I am unable to start my system. At boot, my system stops at the Grub command line.

I want to boot to my Windows 10 installation which I haven't removed from my system.

This is displayed at startup:

GNU GRUB version 2.02 beta2-9ubuntu1.3 <br> 
minimal BASH-like editing is supported.for the first word, TAB lists
possible commands completions.anywhere else TAB lists the possible device or file completion.
grub>

How can I boot my Windows partition from this grub command?

10 Answers 10

67

The following worked for me with a GPT partitioned disk.

insmod part_gpt
insmod chain
set root=(hd0,gpt1)
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
boot

Note that you can enter a command line from the grub boot menu and just type commands as above to test out different combinations.

You need to enter the id of the EFI boot partition (not the windows partition) for the set root= command.

In the command line grub mode ls will list the hard drive partitions, help lists available commands.

Once you have set the root correctly you can ls / to view files and directories to find the correct path to the windows boot manager if it is not in the default location.

4
  • 5
    Make sure to use the ls command for checking the name of your partition, because it might not be (hd0,gpt1). With using the proper partition name I was able to fix Windows booting, thanks to your answer.
    – gyurix
    May 22, 2020 at 0:34
  • This works but I have to run these commands every time I boot the system. It there any way to make it permanent.
    – rupindr
    Jun 10, 2020 at 6:15
  • @rupindr You need to edit /etc/grub.d/##_***** where ##_***** is the file containing your configuration, after that remember to do a update-grub Oct 14, 2020 at 15:08
  • 1
    If EFI file not found after chainloader , then search location of bootmgfw.efi (I searched on another computer via Linux, looks like can use search in grub). Dec 24, 2021 at 5:43
56

Just enter the command exit. It should take you to another menu that makes you select the Windows bootloader.

Worked on Lenovo Y50

7
  • 1
    Worked well on HP i5 7th Gen with Win10 after formatting the Ubuntu partition.
    – Elshan
    Jan 18, 2018 at 18:16
  • Glad it helped! @Elshan Jan 24, 2018 at 22:02
  • Worked in Lenovo ThinkPad, never expected it will work
    – Renjith
    Apr 29, 2018 at 3:53
  • Worked in Lenovo IdeaPad
    – nashvent
    Jul 29, 2020 at 19:40
  • 3
    "exit" just brings me back to the GNU GRUB menu where I choose the different boot systems (Ubuntu or Windows XP in my case) or press c for the grub command-line. I want to get to the msdos command prompt instead. Dec 5, 2020 at 16:38
13

To boot to Windows, if Windows is installed on first drive/partition, enter in grub command line, then boot:

insmod chain
insmod ntfs
set root=(hd0,1)
chainloader +1
boot

see https://www.gnu.org/software/grub/manual/html_node/Chain_002dloading.html#Chain_002dloading for more details.

3
  • 3
    This applies only if the Windows system disk is using MBR partitioning. For the GPT equivalent, see this answer by @79E09796
    – telcoM
    Dec 8, 2018 at 13:36
  • 1
    How can you tell which partition exactly to set as the root? What if it's not (hd0,1)?
    – einpoklum
    Dec 18, 2021 at 16:44
  • 1
    @einpoklum, the partition with Windows, need to know which partition it is. May boot liveUSB Linux distro to check. Worked for me. Do ls in grub command to see a list to check names. Dec 24, 2021 at 5:39
9

Guesing you have an UEFI device, the windows bootloader is still installed. You can select it back in UEFI setup menu under boot, where you will prbably have two options (GRUB and the old default as the second), delete the first one or switch the order.

1
  • I had to restart at least one time until this worked. The first time I tried exit, it told me that some file wasn't found. But on the second attempt, it worked
    – Daniel B.
    Aug 31, 2020 at 21:04
8

This answer is for those with UEFI who have deleted the Ubuntu partitions before removing grub

You will be doing this from Windows 10. No bootable media required.

Where bootrec /fixmbr, bootsect /nt60 and the Ubuntu live with the boot-repair suggestions have failed, this has worked for me:

(This answer borrowed verbatim from here)

  1. Run a cmd.exe process with administrator privileges
  2. Run diskpart
  3. Type: list disk then sel disk X where X is the drive your boot files reside on
  4. Type list vol to see all partitions (volumes) on the disk
  5. Select the EFI volume by typing: sel vol Y where Y is the SYSTEM volume (this is almost always the EFI partition)
  6. For convenience, assign a drive letter by typing: assign letter=Z: where Z is a free (unused) drive letter
  7. Type exit to leave disk part
  8. While still in the cmd prompt, type: Z: and hit enter, where Z was the drive letter you just created.
  9. Type dir to list directories on this mounted EFI partition
  10. If you are in the right place, you should see a directory called EFI
  11. Type cd EFI and then dir to list the child directories inside EFI
  12. Type rmdir /S ubuntu to delete the ubuntu boot directory

Assuming you only ever had two operating systems (Win 10 & Ubuntu) you should now be able to boot directly to Windows without hitting the black grub screen.

Copied from https://askubuntu.com/questions/429610/uninstall-grub-and-use-windows-bootloader

2
  • Worked like a charm
    – Gjaa
    Jan 28 at 21:01
  • Great! working! Aug 20 at 12:52
2

Just exit the grub by typing exit and go to bios setup and restore to default settings and restart the computer.

0
1

I recently bumped into the same problem. (i.e. originally have a a separate partition with Ubuntu installed, dual bootable from a grub menu. I then deleted that Ubuntu partition from Windows disk management, and when I rebooted, just the grub command menu).

What I did to get back to my Windows 10:

  1. Do a Ctrl + Alt + Delete to reboot. While rebooting, hold down the shift button.
  2. My PC then give me to option to press F12 for boot option. I clicked F12, and it gives me back a menu with Windows boot manager on it.
  3. I selected the Windows boot manager and click enter. I'm now back to Windows 10.
0

This worked for me, now I have to find a way to permanently fix the mbr.

I recently bumped into the same problem. (i.e. originally have a a separate partition with Ubuntu installed, dual bootable from a grub menu. I then deleted that Ubuntu partition from Windows disk management, and when I rebooted, just the grub command menu).

What I did to get back to my Windows 10:

Do a Ctrl+Alt+Delete to reboot. While rebooting, hold down the shift button. My PC then give me to option to press F12 for boot option. I clicked F12, and it gives me back a menu with Windows boot manager on it. I selected the Windows boot manager and click enter. I'm now back to Windows 10.

0

Try this, its worked in my case:

grub> exit

You will get a list of operating systems installed. Select one.

3
-2

Try this:

rootnoverify (hd0,0)
chainloader +1
makeactive
boot

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .