Partner links

How to keep your Boot EFI partition clean of old Linux bootloader folders

Delete GRUB from /boot/efi partition

This tutorial shows how to delete bootloader folders of Linux distributions that you have deleted from a dual-boot system.

Imagine for a moment that you set up a Windows-Linux dual-boot system. Later, you deleted the original Linux distribution and installed another Linux distribution in its place.

The dual-boot setup still works beautifully, but traces of the old Linux distribution still exists on a partition of the hard drive reserved for bootloader folders on a UEFI system. That partition is what Windows called EFI System partition.

On Linux, I like to call it the Boot EFI partition because it’s mounted at /boot/efi. If you’re logged into the Linux side of such a dual-boot system, you can view all the bootloader folders on the Boot EFI partition, and delete any that are no longer needed.

Take, for example, the computer I used for Dual-boot Ubuntu 16.04 and Windows 10 on a PC with UEFI firmware and Dual-boot Fedora 25, Windows 10 on a computer with UEFI firmware, and How to Dual-boot Manjaro 16.10, Windows 10 on a computer with UEFI firmware. Though Fedora 25 and Manjaro 16.10 have since been deleted, their GRUB files are still around.

You could delete them while logged into Windows 10 in the same fashion used at How to delete GRUB files from a Boot EFI partition in Windows 10, it’s a lot easier to accomplish the task while you’re logged into the current Linux side.

It simply involves logging into the Linux side, navigating to the /boot/efi/EFI directory, list its contents and deleting the unwanted folder(s), using the commands shown in the following code block. Just be absolutely sure that you do not delete the Microsoft folder. The same goes for the folder of the existing Linux distribution.:

# This is a comment
# Lines starting with > indicate outputs of a command
# Lines starting without # or > indicate commands that you need to type

# This first command is sometimes necessary because of permission issues on some distributions

sudo su

cd /boot/efi/EFI

ls
> Boot  fedora  Manjaro  Microsoft  ubuntu

rm -rf Manjaro

exit

#

If it would make more sense, the following is a screenshot of the steps I used.

Delete GRUB from /boot/efi partition

Figure 1: Deleting old GRUB files from the /boot/efi partition of a dual boot setup

If you’ve used How to delete GRUB files from a Boot EFI partition in Windows 10 to perform the same operation from the Windows side of such a setup, it should be obvious that it’s much easier from the Linux side.

Share:

Facebook
Twitter
Pinterest
LinkedIn

Partner links

Newsletter: Subscribe for updates

Subscribe
Notify of
guest
3 Comments
Inline Feedbacks
View all comments
bob
bob
5 years ago

efibootmgr(8) – Linux man page

knotheu
knotheu
5 years ago

If you have Windows installed and did a dual boot with Linux, use diskpart to clean the efi folder.
Right click on the Windows logo (lower left corner) and open the Power shell (admin).
diskpart
list disk
sel disk 0 (zero) #If you have more than one hard drive the number may be different.
list vol
sel vol 3 # look for the system fat32 and choose the correct volume number
assign letter=s
exit
cd s:\efi
dir
rmdir manjaro #if more than one entry you have to do one at a time. Do not use the tab function, won’t work.
Now lets go back and remove the letter s.
cd c:\windows\system32
diskpart
sel disk 0
sel vol 3 #or what ever number you used
remove letter=s
exit
exit

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
3
0
Hya, what do you think? Please comment.x
()
x