Partner links

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

Figure

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.

 

NFTs were hot in 2021. They will be even more so this year and beyond. NFT South is a conference where NFT enthusiasts will meet to explore and celebrate the different use cases of NFTs. It’s going to be a fun event. Get your ticket today!

 

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.

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. Note: If the ls command is not available in your shell, use the dir command instead.

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.

## These commands are used to identify and select the hard drive

diskpart

list disk

sel disk 0

## These commands are used to list the partitions, select the Boot EFI partition, 
## then assign it a drive letter

list vol

sel vol 2

assign letter=D:

exit

## These commands are used to change into the Boot EFI folder and delete the GRUB folder

cd /d D:

ls

ls EFI

cd EFI

ls

rmdir /s ubuntu

Share:

Share on facebook
Facebook
Share on twitter
Twitter
Share on pinterest
Pinterest
Share on linkedin
LinkedIn

Partner links

Newsletter: Subscribe for updates

Subscribe
Notify of
guest
198 Comments
Inline Feedbacks
View all comments
Mohan
Mohan
6 years ago

Usually, I never put my comments on any of the solutions But this is one of the best solutions that anybody can easily understand.
I hope, that I can install linux again, without any issues…

dscl
dscl
6 years ago

Thank you, the first simple answer i got after searching for a solution and it worked!

Sanjary
Sanjary
6 years ago

Yes. Thanks a lot. Thank GOD at last I found your post. I had to google a lot.

But the ‘cd /d D:’ & ‘ls’ command don’t work for me.

What I did from the 21st line of your code block
>D:
>dir EFI
>cd EFI
Then from 31st line, the same.

Christian
Christian
6 years ago

Hey! everything worked fine for me.
I have the same doubt as @Richard
But how can I remove de D: partiton from File Explorer.

Nep
Nep
Reply to  Christian
6 years ago

you know that step where you used the “assign letter=D” command? Open another command line, and follow all the previous step, but when you get to this step, use “remove letter=D” instead.
so:
>diskpart
>listdisk
>sel disk 0
>list vol
>sel vol 2
>remove letter=D

Richard
Richard
6 years ago

Thank you very much!! But how i can remove the D: partition from my file explorer???

Nep
Nep
Reply to  Richard
6 years ago

you know that step where you used the “assign letter=D” command? Open another command line, and follow all the previous step, but when you get to this step, use “remove letter=D” instead.
so:
>diskpart
>listdisk
>sel disk 0
>list vol
>sel vol 2
>remove letter=D

AbZurd
AbZurd
6 years ago

Hey,
Much like Tessa, I get the Access Denied message when I try to enter the “cd /d D:” command. I have no idea how to continue.
I have administrator rights on the Win10 installation I am using. I also have the same terminal window open that I started with initially.
Should I try with PowerShell instead? Other suggestions?

Daithi
Daithi
Reply to  AbZurd
6 years ago

Hi to get around this in windows search for “cmd” when it shows up, right click and select run as administrator. Hope this helps.

Elias Tenece
Elias Tenece
6 years ago

Thank you so much! I almost gave Up man!! I literally couldn’t do anything whenever I tried booting from a live USB it started loading and got frozen. I couldn’t even open the command line so I could type the commands most people suggested.

gilles
gilles
6 years ago

When I enter the ‘ls’ command I receive the answer : ‘ls’ is not recognized as an internal or external command, operable program or batch file. What can I do to fix it?

Tessa
Tessa
6 years ago

Hey! Thank you so much! Im getting an error that says “access denied” when i try to do the last set of steps… do you have any suggestions? Thank you so much 🙂

Nessim
Nessim
6 years ago

Hi – this worked great, but boot manager still has “kali” in it, when I press the screen goes black then goes back to the boot manager.
its just a corrupted name now. any clue how I can fix it?

Kozero
Kozero
6 years ago

Thanks a million, after hours of struggle savior rescues me and now I have a grub free computer. I did this on windows 8.1 and replaced the “ls” command with “dir”.

M Salman Tariq
M Salman Tariq
6 years ago

Thank you so much man it worked finally after looking for many other tutorials.

However the “ls” command didnt work and wasnt recognized as internal or extranal command so i directly tied cd EFI and first deleted ubuntu and then grub as well.

what caused this was the fact that i deleted ubuntu and merged the partitions but in EFI the grub and ubuntu remained and hence grub loaded instead of windows, now that grub and ubuntu are both gone now only Windows 10 loads.

Thanks again.

Som
Som
6 years ago

Great tutorial. It solved my problem. This is the easiest method it can be scariest for some people though. Other option is through USB recovery disk.

OC-MVP
OC-MVP
6 years ago

Thank you, after going through all other websites and videos, this worked for me!!!! Thanks once again

aarn
aarn
6 years ago

Gosh you do suggest a complex undertaking!. I have a 64bit dual boot win 10 preview (the penultimate one) and good old lubuntu 14.04. I downloaded the .iso for win10 (build 10264 or somesuch) and created a bootable usb using rufus.exe. Then I opened the usb and deleted the UEFI folder, and another UEFI subfolder.
Closing down and rebooting from a usb with bootable lubuntu 14.04, the main drive was formatted to FAT32. Closing down again, the system was rebooted from the bootable win10 usb, and win10 installed (25 character product key was required).
The result was a system with 300Mb legacy (not UEFI) boot partition and the rest devoted to win10. From there it was just the usual downsize the win10 partition (it was left with 40Gb on a 120Gb ssd) and install lubuntu 14.04.3 in the 80Gb empty space, which the usb recognised automatically.
So, this method ‘misses out’ on the advantages (???) of UEFI. But once you have your dual-boot system running, in win10 go to then and switch off/over-ride all the ‘hibernate’ and ‘sleep’ options. When you reboot into linux, your win10 partition should be totally accessible. Whereas with a UEFI boot partition, and/or sleep/hibernate options enabled, linux finds it difficult to work with win10

1 2 3 9

Get the latest

On social media

Security distros

Hacker
Linux distros for hacking and pentesting

Crypto mining OS

Bitcoin
Distros for mining bitcoin and other cryptocurrencies

Crypto hardware

MSI GeForce GTX 1070
Installing Nvidia GTX 1070 GPU drivers on Ubuntu

Disk guide

LVM
Beginner's guide to disks & disk partitions in Linux

Bash guide

Bash shell terminal
How to set the PATH variable in Bash
Categories
Archives
198
0
Hya, what do you think? Please comment.x
()
x