Linux – Dual Booting Delete Linux EFI Partition

bootlinuxmulti-bootpartitioningwindows

So I am trying to re-install the Linux on my laptop. Currently, I am dual booting between Windows and Linux and when I have checked I have two EFI System Partitions (ESP). I want to get rid of the one which I have created when installing Manjaro, and leave intact the Windows one, in case I want to revert back fully to Windows on that particular machine.

Is there a particular way to check which ESP is for Linux and which for Windows and Linux? I presume the first partition should be the Windows ESP, but I am not 100% sure.

Best Answer

Run efibootmgr -v from Linux (which will show your EFI boot menu) and compare each entry's GUID with the GPT partition GUIDs that are shown by partx /dev/sda or lsblk -o name,partuuid.

You can also actually look inside and check what files are in each partition, as each ESP is just a standard mountable FAT32 partition:

  • Windows always creates a \EFI\Microsoft directory and installs BOOTMGR (bootmgfw.efi) as its boot manager. You'll also find files like "BCD".

  • Linux will generally install grubx64.efi or systemd-bootx64.efi as the boot manager. Generally, this will be the partition that Mint automatically mounts at /boot/efi.


In case you're only able to boot Windows but not Linux:

  1. From an Administrator console, use mountvol /s to temporarily assign a drive to your current EFI system partition.

  2. Then use bcdedit /enum {bootmgr} to verify that the EFI boot entry pointing to Windows BOOTMGR is indeed pointing to the same disk (it should show the letter that you just assigned):

    Windows Boot Manager
    --------------------
    identifier              {bootmgr}
    device                  partition=S:
    
  3. Now the important partition is shown as S: in DiskMgmt, and the unimportant partition is still shown without a drive letter.

(You can also use bcdedit /enum firmware to list all EFI boot menu entries. This is the rough Windows equivalent of 'efibootmgr -v' from Linux.)

Related Question