DEV Community

Cover image for How to Remove Orphan Linux Boot Entries from Windows 11 UEFI
Igor Giamoniano
Igor Giamoniano

Posted on

How to Remove Orphan Linux Boot Entries from Windows 11 UEFI

Level: Intermediate

Estimated Time: 15–20 minutes

Operating System: Windows 11 (UEFI systems)


Summary

After replacing a Linux installation (such as Pop!_OS, Ubuntu, or Arch Linux) with Windows 11, old boot entries may remain visible in UEFI firmware.

This happens because UEFI boot configuration is stored in:

  1. EFI System Partition (ESP)
  2. UEFI NVRAM boot entries

Both must be cleaned.

⚠️ Before you start: Backup your data. Modifying the EFI partition or NVRAM entries can make your system unbootable if done incorrectly.


Technical Background

EFI System Partition (ESP)

The EFI System Partition (ESP) is a FAT32-formatted partition that stores the bootloaders for all installed operating systems. On Windows systems, it typically ranges from 100–500 MB in size and is labeled as "System".

Typical structure:

EFI/
├── Microsoft/
├── Boot/
├── pop_os/
├── systemd/
├── ubuntu/
└── linux/
Enter fullscreen mode Exit fullscreen mode

⚠️ Do NOT remove:

  • Microsoft/
  • Boot/

NVRAM Boot Entries

UEFI firmware stores boot entries in non-volatile memory.

Each entry contains:

  • GUID identifier
  • Description
  • Path to EFI loader
  • Device reference

Removing EFI files does not remove NVRAM entries.


Step 1 — Mount EFI Partition

Open Command Prompt as Administrator.

diskpart
Enter fullscreen mode Exit fullscreen mode
list disk
select disk 0
list partition
Enter fullscreen mode Exit fullscreen mode

⚠️ Replace 0 with your system disk number.

select partition 1
assign letter=Z
exit
Enter fullscreen mode Exit fullscreen mode

⚠️ Replace 1 with the EFI partition (~100–500 MB, Type: System)


Step 2 — Remove Linux Bootloader Files

Z:
cd \EFI
dir
Enter fullscreen mode Exit fullscreen mode

Remove Linux folders:

rmdir /s /q systemd
rmdir /s /q pop_os
Enter fullscreen mode Exit fullscreen mode

Parameters:

  • /s → removes directories recursively
  • /q → quiet mode (no confirmation)

Permission Errors

takeown /f systemd /r /d y
Enter fullscreen mode Exit fullscreen mode

Parameters:

  • /f → target folder
  • /r → recursive
  • /d y → auto confirm

💡 On Portuguese Windows, use /d s instead of /d y.

icacls systemd /grant Administrators:F /t
Enter fullscreen mode Exit fullscreen mode
rmdir /s /q systemd
Enter fullscreen mode Exit fullscreen mode

Step 3 — Remove NVRAM Boot Entries

3.1 List firmware entries

bcdedit /enum firmware
Enter fullscreen mode Exit fullscreen mode

Example output:

Firmware Application (101fffff)
-------------------------------
identifier              {29c75bf6-3303-11f1-b7f4-e7fe7d8485ec}
device                  partition=\Device\HarddiskVolume1
path                    \EFI\systemd\systemd-bootx64.efi
description             Pop!_OS

Firmware Application (101fffff)
-------------------------------
identifier              {bootmgr}
device                  partition=\Device\HarddiskVolume2
path                    \EFI\Microsoft\Boot\bootmgfw.efi
description             Windows Boot Manager
Enter fullscreen mode Exit fullscreen mode

3.2 Identify entries to remove

Remove entries that reference:

  • systemd
  • pop_os
  • ubuntu
  • linux

3.3 Delete orphan entry

bcdedit /delete {29c75bf6-3303-11f1-b7f4-e7fe7d8485ec} /f
Enter fullscreen mode Exit fullscreen mode

Parameter:

  • /f → force deletion without confirmation

⚠️ NEVER delete:

  • {bootmgr}
  • {current}

Step 4 — Remove drive letter

diskpart
select disk 0
select partition 1
remove letter=Z
exit
Enter fullscreen mode Exit fullscreen mode

Troubleshooting

Problem 1 — Access denied

takeown /f systemd /r /d y
icacls systemd /grant Administrators:F /t
rmdir /s /q systemd
Enter fullscreen mode Exit fullscreen mode

Problem 2 — delete fails

Possible causes:

  • entry already removed
  • firmware protected entry
  • invalid reference

Solution:

  • reboot
  • remove EFI files first
  • run again

Problem 3 — entry still appears

Possible causes:

  • firmware cache
  • fallback recreated
  • BIOS bug

Solutions:

  • reboot twice
  • load BIOS defaults
  • update BIOS

Problem 4 — Windows does not boot

Method 1 — Startup Repair

  1. Boot Windows installer USB
  2. Repair your computer
  3. Startup Repair

Method 2 — Recovery Command Prompt

bcdboot C:\Windows /s Z: /f UEFI
Enter fullscreen mode Exit fullscreen mode

Commands Used


Version Notes

Version Date Changes
1.0 April 2026 Initial procedure
1.1 April 2026 Added EFI explanation
1.2 April 2026 Added NVRAM cleanup
1.3 April 2026 Added troubleshooting
1.4 April 2026 Added command table
1.5 April 2026 Added recovery section
1.6 April 2026 Safety and locale improvements

✅ Quick Checklist (click to expand)

  • [ ] Backup completed
  • [ ] Disk/Partition numbers verified
  • [ ] Microsoft/ and Boot/ preserved
  • [ ] {bootmgr} and {current} not deleted
  • [ ] Drive letter removed

Tested Environment

  • Windows 11 24H2
  • UEFI firmware
  • GPT disk
  • Pop!_OS systemd-boot

Disclaimer

Backup before modifying EFI partition.
Verify disk and partition numbers carefully.

Top comments (0)