How to remove dual-boot ghost entry from uefi

After trying dual-boot of Windows 11 and Ubuntu, I decided to remove Ubuntu due to unknown but likely hardware driver issue causing my laptop's fan to be constantly running noisily regardless of nearly zero CPU or low Memory usage. Following the steps from guides available all over the internet, I deleted the Ubuntu partition and extended the Windows partition back to original volume from Disk management tool. However, there is a leftover issue that is the UEFI (BIOS) now has a ghost boot entry for Ubuntu which does not seem to have a straightforward way to be deleted. After searching on the internet for awhile and finally I found below proved to be working reliably.

Steps taken from the original post with notes

  • Run the command prompt (cmd.exe) with administrator privileges

  • Type diskpart command

  • [Optional, only if you have multiple disk drives] Type list disk and then sel disk X where X is the drive your boot files reside on

  • Type list vol to see all partitions (volumes) on the disk (the EFI volume will be formatted in FAT, others will be NTFS)

  • Select the EFI volume by typing sel vol Y where Y is the SYSTEM volume (this is almost always the EFI partition)

  • For convenience, assign a drive letter by typing assign letter=Z: where Z is a free (unused) drive letter

  • Type exit to leave disk partition

  • While still in the cmd prompt, type Z: and hit enter, where Z was the drive letter you just created

  • Run dir to list directories on this mounted EFI partition

  • If you are in the right place, you should see a directory called EFI

  • Type cd EFI and then dir to list the child directories inside EFI

  • Type rmdir /S ubuntu to delete the ubuntu boot directory

After these steps, boot into UEFI and confirm from the Boot tab the Ubuntu ghost boot entry is gone.

Check Uninstall GRUB and use Windows bootloader for the original post and many thanks.

windows