<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged efi</title>
<link>https://coderlegion.com/tag/efi</link>
<description>Powered by Question2Answer</description>
<item>
<title>How to Remove Orphan Linux Boot Entries from Windows 11 UEFI</title>
<link>https://coderlegion.com/14795/how-to-remove-orphan-linux-boot-entries-from-windows-11-uefi</link>
<description>&lt;p&gt;&lt;strong&gt;Level:&lt;/strong&gt; Intermediate&lt;br&gt;
&lt;strong&gt;Estimated Time:&lt;/strong&gt; 15–20 minutes&lt;br&gt;
&lt;strong&gt;Operating System:&lt;/strong&gt; Windows 11 (UEFI systems)&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;summary&quot;&gt;Summary&lt;/h3&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;This happens because UEFI boot configuration is stored in:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;EFI System Partition (ESP)  &lt;/li&gt;
&lt;li&gt;UEFI NVRAM boot entries  &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Both must be cleaned.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;⚠️ &lt;strong&gt;Before you start&lt;/strong&gt;: Backup your data. Modifying the EFI partition or NVRAM entries can make your system unbootable if done incorrectly.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h3 id=&quot;technical-background&quot;&gt;Technical Background&lt;/h3&gt;
&lt;h4 id=&quot;efi-system-partition-esp-&quot;&gt;EFI System Partition (ESP)&lt;/h4&gt;
&lt;p&gt;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 &quot;System&quot;.&lt;/p&gt;
&lt;p&gt;Typical structure:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;EFI/
├── Microsoft/
├── Boot/
├── pop_os/
├── systemd/
├── ubuntu/
└── linux/
&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;&lt;p&gt;⚠️ Do NOT remove:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Microsoft/&lt;/li&gt;
&lt;li&gt;Boot/&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h4 id=&quot;nvram-boot-entries&quot;&gt;NVRAM Boot Entries&lt;/h4&gt;
&lt;p&gt;UEFI firmware stores boot entries in non-volatile memory.&lt;/p&gt;
&lt;p&gt;Each entry contains:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;GUID identifier&lt;/li&gt;
&lt;li&gt;Description&lt;/li&gt;
&lt;li&gt;Path to EFI loader&lt;/li&gt;
&lt;li&gt;Device reference&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Removing EFI files does not remove NVRAM entries.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;step-1-mount-efi-partition&quot;&gt;Step 1 — Mount EFI Partition&lt;/h3&gt;
&lt;p&gt;Open Command Prompt as Administrator.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-cmd&quot;&gt;diskpart
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-cmd&quot;&gt;list disk
select disk 0
list partition
&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;&lt;p&gt;⚠️ Replace &lt;code&gt;0&lt;/code&gt; with your system disk number.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code class=&quot;language-cmd&quot;&gt;select partition 1
assign letter=Z
exit
&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;&lt;p&gt;⚠️ Replace &lt;code&gt;1&lt;/code&gt; with the EFI partition (~100–500 MB, Type: System)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h3 id=&quot;step-2-remove-linux-bootloader-files&quot;&gt;Step 2 — Remove Linux Bootloader Files&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-cmd&quot;&gt;Z:
cd \EFI
dir
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Remove Linux folders:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-cmd&quot;&gt;rmdir /s /q systemd
rmdir /s /q pop_os
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Parameters:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/s&lt;/code&gt; → removes directories recursively&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/q&lt;/code&gt; → quiet mode (no confirmation)&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&quot;permission-errors&quot;&gt;Permission Errors&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-cmd&quot;&gt;takeown /f systemd /r /d y
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Parameters:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/f&lt;/code&gt; → target folder&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/r&lt;/code&gt; → recursive&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/d y&lt;/code&gt; → auto confirm&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;&lt;p&gt; On Portuguese Windows, use &lt;code&gt;/d s&lt;/code&gt; instead of &lt;code&gt;/d y&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code class=&quot;language-cmd&quot;&gt;icacls systemd /grant Administrators:F /t
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-cmd&quot;&gt;rmdir /s /q systemd
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h3 id=&quot;step-3-remove-nvram-boot-entries&quot;&gt;Step 3 — Remove NVRAM Boot Entries&lt;/h3&gt;
&lt;h4 id=&quot;3-1-list-firmware-entries&quot;&gt;3.1 List firmware entries&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-cmd&quot;&gt;bcdedit /enum firmware
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Example output:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;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
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;3-2-identify-entries-to-remove&quot;&gt;3.2 Identify entries to remove&lt;/h4&gt;
&lt;p&gt;Remove entries that reference:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;systemd&lt;/li&gt;
&lt;li&gt;pop_os&lt;/li&gt;
&lt;li&gt;ubuntu&lt;/li&gt;
&lt;li&gt;linux&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;3-3-delete-orphan-entry&quot;&gt;3.3 Delete orphan entry&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-cmd&quot;&gt;bcdedit /delete {29c75bf6-3303-11f1-b7f4-e7fe7d8485ec} /f
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Parameter:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/f&lt;/code&gt; → force deletion without confirmation&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;&lt;p&gt;⚠️ NEVER delete:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;{bootmgr}&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;{current}&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h3 id=&quot;step-4-remove-drive-letter&quot;&gt;Step 4 — Remove drive letter&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-cmd&quot;&gt;diskpart
select disk 0
select partition 1
remove letter=Z
exit
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h3 id=&quot;troubleshooting&quot;&gt;Troubleshooting&lt;/h3&gt;
&lt;h4 id=&quot;problem-1-access-denied&quot;&gt;Problem 1 — Access denied&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-cmd&quot;&gt;takeown /f systemd /r /d y
icacls systemd /grant Administrators:F /t
rmdir /s /q systemd
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h4 id=&quot;problem-2-delete-fails&quot;&gt;Problem 2 — delete fails&lt;/h4&gt;
&lt;p&gt;Possible causes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;entry already removed&lt;/li&gt;
&lt;li&gt;firmware protected entry&lt;/li&gt;
&lt;li&gt;invalid reference&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Solution:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;reboot&lt;/li&gt;
&lt;li&gt;remove EFI files first&lt;/li&gt;
&lt;li&gt;run again&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h4 id=&quot;problem-3-entry-still-appears&quot;&gt;Problem 3 — entry still appears&lt;/h4&gt;
&lt;p&gt;Possible causes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;firmware cache&lt;/li&gt;
&lt;li&gt;fallback recreated&lt;/li&gt;
&lt;li&gt;BIOS bug&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Solutions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;reboot twice&lt;/li&gt;
&lt;li&gt;load BIOS defaults&lt;/li&gt;
&lt;li&gt;update BIOS&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h4 id=&quot;problem-4-windows-does-not-boot&quot;&gt;Problem 4 — Windows does not boot&lt;/h4&gt;
&lt;p&gt;Method 1 — Startup Repair&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Boot Windows installer USB  &lt;/li&gt;
&lt;li&gt;Repair your computer  &lt;/li&gt;
&lt;li&gt;Startup Repair  &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Method 2 — Recovery Command Prompt&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-cmd&quot;&gt;bcdboot C:\Windows /s Z: /f UEFI
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h3 id=&quot;commands-used&quot;&gt;Commands Used&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th&gt;Command &lt;/th&gt;&lt;th&gt;Purpose &lt;/th&gt;&lt;th&gt;Documentation&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;diskpart &lt;/td&gt;&lt;td&gt;Disk and partition management &lt;/td&gt;&lt;td&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://learn.microsoft.com/windows-server/administration/windows-commands/diskpart&quot;&gt;https://learn.microsoft.com/windows-server/administration/windows-commands/diskpart&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;bcdedit &lt;/td&gt;&lt;td&gt;Manage firmware boot entries &lt;/td&gt;&lt;td&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://learn.microsoft.com/windows-hardware/drivers/devtest/bcdedit&quot;&gt;https://learn.microsoft.com/windows-hardware/drivers/devtest/bcdedit&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;takeown &lt;/td&gt;&lt;td&gt;Take ownership of files &lt;/td&gt;&lt;td&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://learn.microsoft.com/windows-server/administration/windows-commands/takeown&quot;&gt;https://learn.microsoft.com/windows-server/administration/windows-commands/takeown&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;icacls &lt;/td&gt;&lt;td&gt;Modify permissions &lt;/td&gt;&lt;td&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://learn.microsoft.com/windows-server/administration/windows-commands/icacls&quot;&gt;https://learn.microsoft.com/windows-server/administration/windows-commands/icacls&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;rmdir &lt;/td&gt;&lt;td&gt;Remove directories &lt;/td&gt;&lt;td&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://learn.microsoft.com/windows-server/administration/windows-commands/rmdir&quot;&gt;https://learn.microsoft.com/windows-server/administration/windows-commands/rmdir&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;bcdboot &lt;/td&gt;&lt;td&gt;Rebuild Windows bootloader &lt;/td&gt;&lt;td&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://learn.microsoft.com/windows-hardware/manufacture/desktop/bcdboot-command-line-options&quot;&gt;https://learn.microsoft.com/windows-hardware/manufacture/desktop/bcdboot-command-line-options&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;hr&gt;
&lt;h3 id=&quot;version-notes&quot;&gt;Version Notes&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th&gt;Version &lt;/th&gt;&lt;th&gt;Date &lt;/th&gt;&lt;th&gt;Changes&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;1.0 &lt;/td&gt;&lt;td&gt;April 2026 &lt;/td&gt;&lt;td&gt;Initial procedure&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;1.1 &lt;/td&gt;&lt;td&gt;April 2026 &lt;/td&gt;&lt;td&gt;Added EFI explanation&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;1.2 &lt;/td&gt;&lt;td&gt;April 2026 &lt;/td&gt;&lt;td&gt;Added NVRAM cleanup&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;1.3 &lt;/td&gt;&lt;td&gt;April 2026 &lt;/td&gt;&lt;td&gt;Added troubleshooting&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;1.4 &lt;/td&gt;&lt;td&gt;April 2026 &lt;/td&gt;&lt;td&gt;Added command table&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;1.5 &lt;/td&gt;&lt;td&gt;April 2026 &lt;/td&gt;&lt;td&gt;Added recovery section&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;1.6 &lt;/td&gt;&lt;td&gt;April 2026 &lt;/td&gt;&lt;td&gt;Safety and locale improvements&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;hr&gt;
&lt;details&gt;
&lt;summary&gt;✅ Quick Checklist (click to expand)&lt;/summary&gt;

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

&lt;/details&gt;
&lt;hr&gt;
&lt;h3 id=&quot;tested-environment&quot;&gt;Tested Environment&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Windows 11 24H2&lt;/li&gt;
&lt;li&gt;UEFI firmware&lt;/li&gt;
&lt;li&gt;GPT disk&lt;/li&gt;
&lt;li&gt;Pop!_OS systemd-boot&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&quot;disclaimer&quot;&gt;Disclaimer&lt;/h3&gt;
&lt;p&gt;Backup before modifying EFI partition.&lt;br&gt;
Verify disk and partition numbers carefully.&lt;/p&gt;
</description>
<category>Tutorials</category>
<guid isPermaLink="true">https://coderlegion.com/14795/how-to-remove-orphan-linux-boot-entries-from-windows-11-uefi</guid>
<pubDate>Tue, 14 Apr 2026 14:09:31 +0000</pubDate>
</item>
</channel>
</rss>