Tutorials/Tips

How to delete GRUB files from a Boot EFI partition in Windows 10

After several failed attempts to dual-boot Ubuntu 15.04 and Windows 10 on a single hard drive and on a computer with UEFI firmware, and not knowing what caused the first failed attempt, I figured that subsequent failed attempts must have been due to an existing Ubuntu GRUB folder in the Boot EFI folder.

Especially since the machine always froze when the installer is attempting to install GRUB

So I thought that If I could just delete the ubuntu folder from the Boot EFI folder, that the installation would complete – successfully. Ultimately, it didn’t, but I figured out how to delete GRUB files from inside Windows 10, from the command line.

This post documents how it was done. It involved, from the command line, listing and selecting the detected hard drives, listing the partitions on the hard drive, then, finally, listing and deleting the target folder. Another reason you might want to do this, is if you deleted the Linux partitions, which would not automatically delete the GRUB files from the Boot EFI folder.

To start, log into Windows 10, click on the menu and type cmd. Then right-click on the terminal application’s icon and select run as administrator. Figure 1 show the commands (underlined) used to accomplish the first step – listing and selecting the hard drive. To make it possible to copy-and-paste, for those who might need to, I’ve provided the commands in the code block after the last image.

Related Post:  Selecting a colocation provider: 7 keys to consider

In this figure, the target disk is shown as a 465 GB hard drive, with GPT partition.

Windows 10 diskpart
Figure 1: Using diskpart to list hard drives detected on Windows 10

After the target disk has been selected, its partitions are listed, so that the partition (volume) that corresponds to the Boot EFI folder can be identified. In Figure 2, that partition is Volume 2. It’s usually the only volume with FAT32 in the Fs (file system) column, and System in the Info column. After it has been identified and selected, you assign it a drive letter to make it easier to work with. In this example, I assigned it a drive letter D. After that, exit diskpart.

Listing Windows 10 partitions
Figure 2: Listing disk partitions on Windows 10

The final task involves changing into the Boot EFI folder, listing its contents to identify what subfolder the GRUB files would be. It will be in the EFI folder. The GRUB files for the distribution that was installed will be under a folder of the same name as the distribution. For example, if Ubuntu was installed, as in this example, the name of the folder will be ubuntu. Delete the folder using the rmdir /s command. That’s the Windows 10 equivalent of the Unix/Linux rm -r command.

Delete Ubuntu Boot EFI GRUB files
Figure 3: Deleting non-empty Ubuntu GRUB directory in Windows 10

All the commands used are given in this code block. Note that this procedure is not necessarily the best or only way to go about do this, so if you know of a better method, post a comment.

Related Post:  Kali Linux, Windows 10 and the Windows Subsystem for Linux

Subscribe to LinuxBSDos.com

Subscribe to receive the latest articles in your Inbox

I agree to have my personal information transfered to MailChimp ( more information )

Trust me, you'll not be spammed...

Please share:

We Recommend These Blockchain Conferences and Servicess

Register now for Blockchain & Decentralized Tech SuperSummit, international conference on blockchain technnology in Dallas, TX (USA), October 30 - November 2, 2018

Learn how to trade cryptocurrencies profitably using technical and fundamental analysis at BDT SuperSummit

Best binary auto trading software reviews by 7binaryoptions.com

Launch an SSD VPS in Europe, USA, Asia & Australia on Vultr's KVM-based Cloud platform starting at $5:00/month (15 GB SSD, 768 MB of RAM).


137 Comments

  1. Thanks you; it worked like a charm.

  2. Iannis de Zwart

    THANK YOU SOOO MUCH!
    I couldn’t reset my pc any more, this guide is awesome!

  3. WOW – cpu is back from the dead after deleting ubuntu partition – thanks a bunch!!!

  4. Saiful Islam

    Hello,

    I named my drive as J. And tried entering J. But Can’t access. Can you please me what should I do now?

  5. Thanks for help buddy.

  6. THANK YOU…you saved my computer after following others instructions for uninstalling ubuntu. Those web sites did not address the EFI files and I was stuck in a GRUB loop on start-up. I am now up and running!

  7. Amazing its work!!!!
    Thank u!!

    Anyway, you can use LS command at powershell windows 10 instead of cmd

  8. Just a heads up, LS doesn’t work under Windows. It’s a Linux command. The command that needs to be used is actually DIR. You’ll get an error if you try and use ls..

  9. Thanks Working..

    if “ls” command doesn’t work then try “dir”

Leave a Reply to Doityo Cancel

Your email address will not be published. Required fields are marked *

*