Removing Grub after upgrading to Windows 10

I had to look for this around the internet a bit so I thought it might be useful to write it al down in one place. It turns out it is actually rather easy to remove GRUB from a Windows 10 machine and it does not require startup disks or anything like that.

The situation

My laptop contains a single hard drive that was split up between Windows 7 and Ubuntu Linux. The Ubuntu install has been upgraded a few times along the way and is now at Ubuntu 16.10. I have decided I am going to stop using Ubuntu on this laptop so I would like to remove it. Windows 7 was installed on a primary partition with a restore partition being the first partition on the hard drive. I upgraded Windows 7 to Windows 10 when it was released. Obviously I moved all files I wanted to keep from of the Linux partitions to other places as I intend to delete them. I would also advise creating a backup of the files on the Windows partitions, just in case you accidentally delete the wrong partition or otherwise corrupt it.

Remove Grub, reinstall Master Boot Record

Use the new settings screen to restart the computer into recovery mode by opening Settings and clicking on the Updating & Security icon. Then click Recovery and click the Restart Now button below Advanced Startup.

In the recovery mode choose Troubleshoot, Advanced Options, Command Prompt and log in to an administrators account. Then type the following commands (and ignore any messages about 0 Windows installs found, this is apparently referring to extra installs, not your primary install).


Your Master Boot Record should now be restored and your computer will boot right into Windows when you restart. Feel free to go ahead and try it or stay in recovery to move right along to the next step of removing the partitions.

Remove the partitions

If you have tried out booting your system with the MBR please return to the Recovery command line like before. The precise commands depend on the layout of your partition table but it will look something like this:

list disk
select disk 0 (assuming your hard drive is disk 0)
list partition
select partition 5
delete partition
select partition 6
delete partition
select partition 0
delete partition

If you are unsure about what type a partition is you can select it and display its details before you delete it:

detail partition

Your partitions should now be deleted.

Resize the Windows partition

Now that we have freed up the disk space used by the Linux partition we can use this space to increase the size of the Windows partition back to its original size. Again, please check which partition is your main Windows partition by checking the sizes and details of the partitions. There might be a restore partition on something similar on your hard drive, you’re probably looking for the partition that is currently the largest in size.

select partition 3

Your primary partition should now be the complete. Note this only works for contiguous space so it depends on your partition tables layout whether this is possible. If you have simply installed Linux in the past in addition to an already installed Windows this should probably not be a problem though.

Reboot and (optionally) scan the hard drive

Type exit twice to leave diskpart and the Recovery command line and then boot into Windows. I performed a file system check at this point but no problems were found so it appears this was al taken care of by diskpart and/or Windows. It might not be a bad idea to check your hard drive just in case though.

Your Windows should now boot directly again and all disk space should be available to it. Enjoy!