Deleting Linux Entry from Boot Menu from Windows After Removing Linux

Removed the Linux partition from dual boot set up but Linux entry is still there in the UEFI boot settings? H ere's how to get rid of it if you really want it.
Warp Terminal

Recently, I bought an Asus Zenbook and dual booted it with Ubuntu. But Ubuntu 24.04 didn't perform well on the new hardware and thus I removed Ubuntu from dual boot.

This is typically done by moving the Windows boot manager up the boot order and deleting the Linux partition from within Windows.

The annoyance is that Linux will still show up in the UEFI boot settings.

Even though Linux is deleted from dual boot, Ubuntu Linux entry still shows up in UEFI BIOS boot settings

Although it doesn't hurt to leave it there, it triggers some sort of OCD in me to get a pristine system without unnecessary stuff.

And hence, I went out to 'fix this non-issue' and I am going to share how you can do the same if you like.

The process is composed of these two steps:

  • Mount the EFI system partition (ESP) in Windows (has to be command line)
  • Delete the Ubuntu/Linux entry from the EFI folder using either command line or GUI
πŸ“‹
Again, the Linux entry in the UEFI boot menu is not a blocking issue and you can leave it as it is to use only Windows on the system.

Step 1: "Mount" the EFI partition in Windows

Press the Windows start button and look for CMD. Right click on it and select "Run as administrator".

Run command prompt as adminstrator

Once the command prompt is open, start the disk partition utility by entering:

diskpart

Type "list disk" to list all the disks present on your system and get the name of the disk where the EFI partition is located.

list disk

If you have only one disk, it should show only one entry.

List all the disks in Windows command line

Enter the disk to see all the partitions on this disk:

select disk 0

You should see 'Disk 0 is now the selected disk' in the ouput.

Now, list all the partitions on this disk with:

list partition

Usually, it is the system partition that is EFI partiton and as you can see in the screenshot below, it is the partition number 1.

List all the partitions on the disk
🚧
Since my ESP (EFI System Partition) has assigned number 1, I'll select this partition. Yours could be different, so pay attention.
select partition 1

Now, assign it a drive letter. Since C, D, E etc are usually taken, let's go to the end of the alphabet and use the letter x here.

assign letter x
Assign a drive letter to selected ESP

With the EFI partition getting a driver letter, you can now see it in the file explorer like C or D drives.

EFI partition mounted as drive X

Basically, all this hassle for mounting the ESP partition. Anyway, exit the disk partition tool:

exit

Step 2: Delete Linux folder from EFI

Till here, we were not doing anything risky. But now, we have to delete the Ubuntu Linux folder from the EFI partition.

This can be done via graphically as well as via command line. You used the command line above but for 'deleting' something, I would recommend using the graphical method.

Method 1: Use GUI

Open the task manager in Windows (Ctrl+Alt+Del) and here, click the 'Run new task':

Click on Run new task in the Task Manager

This will give you the option to create new task. What you have to do here is to click on the "browse" button:

Access system mounted drives using task manager

You can now browse the partitions and the files inside them. Using this, you can add or delete files and folders.

Browse to drive X and the EFI folder. You should see ubuntu (or whichever distro you used) listed here. Select it first and then right click to see the option to delete it.

Various operating systems listed in EFI folder of ESP partition

I could not take a screenshot of it as Window's built-in tool didn't allow taking screenshots of the right-click context menu. Once you hit the delete option, a conformation dialogue box will pop up.

Delete Ubuntu from EFI from Windows

Select yes and close the browser and then close task manager as well.

Congratulations! Now if you access the UEFI settings from Windows, you won't see the Linux entry anymore.

Command line warrior? Let's see the other method for you.

Method 2: Use command line

πŸ“‹
You need to perform all this in command prompt running as administrator.

Use this command to enter the drive you had mounted earlier. Mind the colon after the drive letter.

x:

See the content of the directory with:

dir

It should show a folder named EFI. Enter this directory:

cd EFI

And now look at the content of this folder:

dir

You should see some folder belonging to Linux. It could be named Ubuntu, Fedora etc.

The next step is to use the rd command (remove directory) with the Linux folder's name to delete it:

rd ubuntu /s

Once done, exit the command prompt by typing exit.

Conclusion

The ESP partition mounted as drive X won't be there anymore when you restart the system. And neither will be the Linux boot entry.

In a YouTube video, I discussed uninstalling Ubuntu from the dual boot system, I mentioned the fact that a leftover Ubuntu entry in the boot doesn't hurt. Still, a few comments indicated that they would like everything cleaned up. Hence, this tutorial.

πŸ’¬ Is it worth the hassle to clean up the Linux boot entry after removing it from dual boot? Share it in the comments, please.

About the author
Abhishek Prakash

Abhishek Prakash

Created It's FOSS 11 years ago to share my Linux adventures. Have a Master's degree in Engineering and years of IT industry experience. Huge fan of Agatha Christie detective mysteries πŸ•΅οΈβ€β™‚οΈ

Become a Better Linux User

With the FOSS Weekly Newsletter, you learn useful Linux tips, discover applications, explore new distros and stay updated with the latest from Linux world

itsfoss happy penguin

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.