0

I am confused about how the EFI partition information sits in Windows recovery media (e.g., in a DVD iso file).

For example, my Windows 10 laptop HDD has 3 partitions: EFI, MSR, and Windows. So, if my HDD dies and I buy a replacement blank HDD, my iso file needs to include this EFI information. To be precise, the EFI information must be present to "help" the motherboard perform that first "recovery boot-from-DVD", and must be present to then be transferred onto the first partition of the new HDD (for subsequent "help" in normal boots). Right? I could very well be wrong from the beginning here, but will assume this to be true.

(In my case, the bulk of the iso file is the "install.esd" sub-file - Is that where my EFI partition is placed? Every other sub-file looks too small.)

Now my real questions:

  1. What happens when I do a "recovery boot-from-DVD" when the HDD has an already-functioning OS - If I choose to install to an empty partition, keeping the old OS for dual-boot, is all of that EFI data on the DVD ignored (since the HDD already has an EFI data partition)?

  2. What happens when I install over (i.e., overwrite) the old OS - Does the EFI partition stay or get replaced?

1 Answer 1

1

The EFI partition doesn't actually have much critical information. It's a regular FAT32 partition that contains one small program (the Windows boot manager) and its configuration file. It doesn't actually deal with things that the firmware can already do by itself (such as detecting DVDs); its job is just to tell the firmware how to boot one or other OS specifically.

You're correct that everything is installed as part of Install.wim (or .esd) image. However, it doesn't come in the form of a pre-made "EFI partition" – it comes in the form of regular files under C:\Windows.

  1. The entire Install.wim image is unpacked to your OS partition, producing such directories as C:\Windows and C:\ProgramData.

  2. Files that consist the Windows boot manager are copied from C:\Windows\Boot\EFI into the desired place within the EFI System Partition (usually under \EFI\Microsoft).

  3. The "BCD" configuration file is generated, telling the Windows boot manager about where to find the main OS partition.

  4. A boot menu entry is added to your firmware's NVRAM, telling it which file (Bootmgfw.efi) is the Windows boot manager.

You can do all of this yourself; step 1 can be done using dism and steps 2–4 can be done using the bcdboot command, both of which come with Windows. (In fact, that's basically all there is to a Windows installation.)

Other operating systems work similarly. (For example, to install systemd-boot on Linux, you just copy the program file /usr/lib/systemd/boot/efi/systemd-bootx64.efi into the EFI System Partition and create a text file that points at whichever Linux kernel you want to boot...)

To be precise, the EFI information must be present to "help" the motherboard perform that first "recovery boot-from-DVD",

Yes, but during boot from DVD, you're only using the EFI files that are on the DVD itself.

and must be present to then be transferred onto the first partition of the new HDD (for subsequent "help" in normal boots).

No, the EFI files used to boot the DVD are completely independent from those used to boot the final OS. They are not copied; instead the files from the OS install image are used.

What happens when I do a "recovery boot-from-DVD" when the HDD has an already-functioning OS - If I choose to install to an empty partition, keeping the old OS for dual-boot, is all of that EFI data on the DVD ignored (since the HDD already has an EFI data partition)?

The bootloader is OS-specific, so each OS almost always needs to install its own copy.

What happens when I install over (i.e., overwrite) the old OS - Does the EFI partition stay or get replaced?

Usually it stays; the installer will err towards keeping possibly useless boot entries instead of removing possibly needed boot entries.

4
  • My impression of EFI is that it's more for the hardware than for Windows, so I'm already a little doubtful. Anyway, I'm looking for the specific rules for my two "real questions" (the last two questions), so for example, if I installed Windows 10 after and alongside Windows 7, would the Windows 10 EFI data in the iso file be thrown away?
    – bobuhito
    Commented Jun 15, 2020 at 1:05
  • Really, I'm getting more and more confused as to what your "EFI data" is. Sounds like you're assuming that the EFI partition contains EFI itself or something like that... It doesn't – not even close. The entirety of the EFI firmware is stored on the motherboard's ROM, just as it was previously with BIOS firmware. Commented Jun 15, 2020 at 7:29
  • Ok, thanks for correcting me (I mistakenly did think one goal of EFI was to move peripheral firmware/processing needs to the main drive/CPU), but that was a digression. To answer my Windows 10+7 question, the new Windows 10 EFI data gets added to the old EFI partition, but this addition is done in a way that is blind to the old EFI partition's data (including any old corruption/virus) whenever Windows 10 boots (which is chosen safely by forced use of the new Windows 10 "Bootmgfw.efi"). Is that fair to say?
    – bobuhito
    Commented Jun 15, 2020 at 12:29
  • I think so, but I am not 100% sure how exactly the Windows 10 installer tries to incorporate the existing Windows 7 - I think that it always fully overwrites the old Windows boot manager with the new one, then adds two OS entries when building the BCD config file. (However, the Windows installer never overwrites or deletes boot managers that belong to other operating systems and live in other folders than "EFI\Microsoft". If you had e.g. Linux installed already, then the Linux bootloader would only get pushed down in the boot priority list, but would otherwise remain untouched.) Commented Jun 15, 2020 at 12:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .