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.
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
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”.
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.
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.
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
With the EFI partition getting a driver letter, you can now see it in the file explorer like C or D drives.
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’:
This will give you the option to create new task. What you have to do here is to click on the “browse” button:
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.
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.
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
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.
Source: Read More