Skip to content

Instantly share code, notes, and snippets.

@valyakuttan
Last active December 7, 2023 03:45
Show Gist options
  • Save valyakuttan/59ca0866c874f9ea6b929cf470127338 to your computer and use it in GitHub Desktop.
Save valyakuttan/59ca0866c874f9ea6b929cf470127338 to your computer and use it in GitHub Desktop.
How to remove GRUB from Windows 11

How to remove GRUB from Windows laptop (MS Surface Pro 3) - the 4x BootRec commands did not work

From Windows 11

=====================

  1. Run a cmd.exe process with administrator privileges
    cmd.exe
  1. Run diskpart
    diskpart.exe
  1. Type: list disk then sel disk X where X is the drive your boot files reside on
    list disk
    select disk X
  1. Type list vol to see all partitions (volumes) on the disk (the EFI volume will be formatted in FAT, others will be NTFS)
    list vol
  1. Select the EFI volume by typing: sel vol Y where Y is the SYSTEM volume (this is almost always the EFI partition)
    select vol Y
  1. For convenience, assign a drive letter by typing: assign letter=Z: where Z is a free (unused) drive letter
    assign letter=Z:
  1. Type exit to leave disk part
    exit
  1. While still in the cmd prompt, type: Z: and hit enter, where Z was the drive letter you just created.
    Z:
  1. Type dir to list directories on this mounted EFI partition
    dir
  1. Type cd EFI and then dir to list the child directories inside EFI
    cd EFI
  1. Type rmdir /S linux-entry to delete the linux boot directory
    rmdir /S entry other than Boot and Microsoft

From Linux

=====================

  1. Run efibootmgr to see current boot order and entries
            sudo efibootmgr
  1. Change boot order to boot from from Windows
            $ # if windows bootnum is 000, and other entries are 003, 004 etc
            $ sudo efibootmgr -o 0,3, 4
  1. Delete Linux boot entries
            $ # if windows bootnum is 000, and other entries are 003, 004 etc
            $ sudo efibootmgr -b 3 -B
            $ sudo efibootmgr -b 4 -B
  1. Go to EFI directory most probably /boot/efi
            $ sudo su
            # cd /boot/efi
  1. Remove that foder having the name of your Linux distribution
            # rm -rf fedora
  1. Reboot your system
@MW2K
Copy link

MW2K commented Dec 7, 2023

This won't work in PowerShell - instead of rmdir /S ubuntu it needs to be Remove-Item ubuntu -Recurse

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment