I installed Ubuntu 18.04 using the "Something else..." option on a laptop with a single HDD that came with Windows 10. During installation I deleted all the partitions except the EFI
partition. Then I created a /
root file-system partition and a /home
partition. All went well.
Except now I have an extra Windows entry in the UEFI boot menu that gets picked up by Grub. I can manually edit /etc/default/grub
to hide the now defunct Windows boot option, but I want to get rid of the entry in the EFI system as well. How do I get rid of this final vestigial remnants of Windows?
Find UEFI boot entries
To remove the now useless Windows boot entry in the UEFI, first you need to find it. This can be done directly from the main Ubuntu OS. There is no need to boot from a live USB/DVD. The installed Ubuntu already has the required commandline utility.
Open a terminal by pressing Ctrl+Alt+T and then enter:
Enter the password when prompted and hit Enter. The cursor won't move and you won't see any asterisks(*****). This is normal in Ubuntu terminal. You will see some output like:
Note, I got two entries other than windows,
0
for "Dell" and 1 for "Windows Boot Manager". Since I deleted all the original partitions except EFI, I can no longer boot "Dell" or "Windows Boot Manager." I could delete both0
and1
. But for this answer I will show how to delete only the Windows Boot Manager entry.Note: the entries you want to delete may be different than this example. Use the output you get from your own computer, not the above example, to decide which entries you want to delete.
Delete the obsolete boot entries
Now that you know you want to delete the entry
1
(in this example), In the terminal enter:Note, the
1
in the command above. This command will delete the entry:Delete the corresponding folder from the EFI partition
We are almost done. This last step makes sure the
UEFI
does not regenerate the entries we just deleted. To do this you have delete a folder corresponding the entry you deleted in the previous steps.If EFI partition is not mounted:
In some computers the EFI partition may not be mounted by default. If this is the case, find out which one is the EFI partition with this command:
and look for the Windows Boot Manager. It may be
/dev/sda1
for example. Yours may be different.Then mount the EFI partition with:
End of "If"
Now you find the name and location of the folder to delete. Use the following command to list all the folders in the
EFI
subfolder in the partition:You will see some output like:
To delete the
Windows
(it may be calledMicrosoft
) folder use the following command:To verify that the folder was deleted, use the
sudo ls /boot/efi/EFI
command again.Finally update GRUB to hide the GRUB menu
At this stage when you boot the laptop, GRUB will still show the menu to choose various OSs, even though you have only Ubuntu installed. Edit the file
/etc/default/grub
with the following command. You may use any other editor if you want.Make the two lines look like this:
If the line
GRUB_TIMEOUT_STYLE=hidden
does not exist, add the line as above.When done, save and exit the editor by Ctrl+X, followed by Y and Enter.
The final step is to update GRUB with the following command:
Now the laptop should directly boot Ubuntu without showing the GRUB menu. If you need to get to the recovery mode in the future, then hit Esc while the laptop boots to reveal the GRUB menu.
Reference: This answer is based on How do I remove "Ubuntu" in the bios boot menu? (UEFI)
Open Terminal.
cd /boot/efi/EFI
. Remove Microsoft folder -sudo rm -R Microsoft
. You can also remove the Boot folder -sudo rm -R Boot
.To remove Windows entry from grub2,
sudo gedit /boot/grub/grub.cfg
. Look for menu entry, Windows Boot Manager (or similar name description) and delete lines up to and including closing curly bracket, then save.Job done. Restart.