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:  Linux and the beauty of browser-based games

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:  5 things to do that will boost the security profile of your smartphone

Please share:

We Recommend These Blockchain Conferences and Servicess

Register now for Blockchain & Decentralized Tech SuperSummit, international conference on blockchain technology in Dallas, TX (USA), April 1 - 4, 2019

Reasons to use control panel for your server

Today's valid web hosting discount codes

Learn how to trade cryptocurrencies using technical and fundamental analyses 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).


170 Comments

  1. It really works fine! A hassle free way to remove grub. Didn’t work “ls” hence skipped it and moved on to the later commands directly, it worked for me.
    THANK YOU VERY MUCH

  2. Thank you so much! We need more people like you. ๐Ÿ™‚

  3. “ls” not work, hmmm i change this with “dir”

    thanks for tutor

  4. ramit pahwa

    cannot cd into EIF please help!!

  5. Akshay Ramnath

    I dual booted Kali and Windows 10. I tried doing the same as said above. However I failed. Inside the EFI directory , there were the below mentioned folders
    18-10-2014 19:11 .
    18-10-2014 19:11 ..
    18-10-2014 19:11 Microsoft
    0 File(s) 0 bytes
    3 Dir(s) 268,238,848 bytes free

    I tried deleting . and .. directories but it said something like this.

    B:\EFI>rmdir /S .
    ., Are you sure (Y/N)? y
    .\MICROS~1\BOOT\BCD – The process cannot access the file because it is being used by another process.
    .\MICROS~1\BOOT\BCD.LOG – The process cannot access the file because it is being used by another process.
    The process cannot access the file because it is being used by another process.

    How can I remove the grub in that case??
    Please help me out with this issue. Im unable to find a solution.

    • The output you gave shows that your EFI folder contains just the Microsoft directory and nothing else.

      The . (dot) directory refers to your current working directory, which you cannot delete. Same applies to the .. (dot dot) directory, the parent directory of your current working directory.

  6. Nair Ul Islam

    Thanks mate. After wasting around 5 hours finally something worked at last.
    PS. For me and some others too the ls command may not work. If it happens then just type the next command ls EFI which should be followed by cd EFI and then finally enter rmdir /s ubuntu

  7. Oh god! After searching in the web for months. More or less 6 mos. Finaallly i found this๐Ÿ˜ thought i need to formt my PC. Cheers man! ๐Ÿ˜™๐Ÿ˜™๐Ÿ˜™

  8. I typed \”ls\” and it said, \”\’ls\’ is not recognized as an internal or external command, operable program or batch file.\”

  9. Thank you very much , you are life saver ๐Ÿ™‚

  10. Soana Mumba

    I knew there was a way to resolve this without going through the Windows Recovery fuss (as seen from another website). You saved my day and followed you at each and every step and it worked like magic when I rebooted. To all those getting issues, just follow each of the steps religiously and assign drive letters that are not in use by the system. It should really work, God bless you all!!

  11. Thank you mate it works, you saved 3 hours of my saturday!!
    I was already downloading windows iso to repair mbr from dvd.
    Really thank you

  12. i make label as “K” and when i type command “cd /d K:” its says “access is denied” what wrong i am doing.
    i want to delete/remove grub loader so that i can use window without booting grub loader.
    my system was a Dual OS window 8.1 and ubuntu and i deleted ubuntu partition from window then-after when i start my laptop it show grub loader .
    Thanks

  13. Worked for me. Thanks.
    Does the ubuntu folder delete have any repercussion?

  14. I’m sorry , I didn’t make a difference between the c volume and the efi volume where actually is efi folder.It is a matter of habit – i used to work with main volumes like c, d, etc, because i had MBR disks,now they are GPT and there are other volumes like system reserved,efi. And when I looked at the tutorial and it says “sel volume 2 ” , I thought it is c volume, because of my habit( c volume stores all system files in mbr partitioning scheme ) , I didn’t pay attention to the details.

    Keep sharing such nice tutorials!

  15. Hi,

    I’ m trying to assign a different letter of the C drive, but i get this: Virtual Disk Service error:
    Assigning or removing drive letters on the current boot or pagefile
    volume is not allowed.
    What is the way of solving that problem?

Leave a Comment

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

*