My windows 10 install moved its EFI partition to another drive, How do I move it back, and make sure it doesn't happen again?

I run a dual-boot setup, with windows 10 on a 250 GB Samsung 950 EVO M.2 NVMe drive, and linux installed on a 1TB 850 EVO M.2 SATA drive.

I recently upgraded my system with a new motherboard (ASUS X570-P), CPU (AMD R9 5950x), and GPU (Sapphire pulse AMD RX 6800 XT). I re-used both of the above mentioned drives. To my surprise, and delight, with the old drives plugged into the new motherboard the system booted right away.

I proceeded to install drivers etc. on my windows install, played a few games, then decided to try my luck with my linux install.

To my dismay, I found that my windows install was now booting from the EFI partition on my linux drive, and (digging a bit further) my windows drive no-longer contained a EFI partition at all.

How can I

  1. get my windows EFI partition back where it belongs
  2. make sure windows doesn’t clobber my linux EFI partition again?

Thanks.

there’s your problem

you’d need to do a clean install of windows and probably fix your EFI on linux (which I don’t know how to do)

when selecting the drives on windows installer you need to know the number of the drive you want for windows, then you delete all partitions and choose only that to create a new one, it does all automagically, the way m$ loves it and you’re set

Windows is awful when it comes to these sort of stuff. I think you need to reinstall Windows making sure just the Windows OS drive is connected.
I don’t think that moving the partition is gonna making the OS able to boot properly.

While I do agree that that would solve my problem, I’m reluctant to do it because my current install is actually working perfectly (other than the whole killing the linux EFI partition malarkey)

here I have found some instructions for creating and populating an EFI partition under windows, which will probably work for me, however I’m worried that the next time that I run windows update it will find my linux EFI partition again and put me back in the same situation.

“Having another drive attached while installing can cause situations with where partitions are placed… If you already have a EFI system partition on another drive, it will be used for the new install…”

From my situation, it looks like the above also applies to updates :frowning: What I need to know is how I can get windows to keep its hands off of my linux EFI partition.

Yeah, I have no problem doing that, my only current problem with that is that my windows EFI partition is sitting where I need my linux EFI partition to be.

While this is a possibility, It doesn’t solve the problem that a future windows update will again clobber my linux EFI partition (even with a fresh install). I need windows not to touch drives I haven’t told it to touch!

If it was a Windows update that changed that it’s very weird! I’ve gone through basically all the Windows revisions with two drives in my system and none of them ever moved any Windows partition to another drive.

Was it the H2 update that did that?

I had given my old system (minus the drives) to my brother for christmas, and due to lack of CPUs and GPUs I only managed to get my new system last Monday. So the update that broke the system was one that launched between December 2020 and now. It was probably applying several updates at once

I think what I may do is to stop dual booting and run windows as a virtualized guest under windows with the GPU passed-through to it.

I’ve been holding off on doing that because my old machine didn’t have enough CPU cores to make it feasible, and I don’t have a second GPU on hand for the host OS, but this may be just the kick I need to invest the time in making that work.

Not sure why it moved on the Linux disk, but whatever. Sometimes when I clone Windows laptops, they happen to either come with MBR and I have to convert to GPT and make an EFI partition, or they come with empty EFI :man_shrugging:

In any case, make a backup and let’s get this going:

  • Remove your Linux drive !!!
  • Boot into a Recovery Mode → Advanced → CMD
  • Follow these commands:
    diskpart
    list disk
    sel disk 0 (might not be 0, might be another disk number)
    list volume
    Here look for the small (around a few hundred MBs) FAT32 partition. It’s usually volume 1, but for some reason, it becomes volume 4 for me, not sure why. :man_shrugging:
    select volume 1 (might be another volume number)
    assign letter v:
    exit
    Look inside v: to check if there are any files on it:
    dir v:
    You should only be seeing an efi folder in it. If it’s empty, that’s ok too.
    bcdboot c:\Windows /s V: /f UEFI (it might not be C: where Windows is installed, so look for it using “dir letter:” until you find your partition where Windows, Program Files, Users etc. are located).

@ThatGuyB Thanks for the walkthrough

This is problematic for two reasons:

  1. in the future when an update needs to touch the EFI system partition it may do this all over again (unless I pull my linux drive every time I update)
  2. I need to pull out my GPU in order to access the slot which has my linux drive in it which is super annoying. . . I might be able to get around this by disabling this slot in the BIOS temporarily instead of physically removing the drive.

So, beyond getting the windows EFI partition back where it belongs, I need a way to ensure that Windows will not do this again. So far all I have thought of is never booting directly into windows, and using a windows VM for all my windows based computing needs.

If there is another way to get windows not to meddle on drives where it shouldn’t, I’m all ears.

You can do it without pulling your drive out, but it’s just safer this way. So do it on your own risk :slight_smile:

If you are going to run Windows as a VM (eventually with GPU Passthrough or something), you can actually passthrough your Sata drive as well. Set your Linux as your first boot option and you should be good to go I think. But I can’t be sure about that, as I never dual-boot anymore. Good luck though.

Use a partition maker and make a partition on whichever drive windows is NOT overwriting. Install your linux bootloader there. Set in bios to boot off of that drive as primary and windows drive as secondary. Windows will never fuck with it especially if you disable the linux drive in windows. This is how I prevented this issue with my windows 10 install.

1 Like