Image courtesy of CGSecurity, see Additional Resources

Things you need

  • A copy of Lubuntu
  • Windows 10 Install Disc
  • An internet connection

Additional Resources

Things to remember

  • Do not write anything on that disk anymore, you do not want to overwrite anything.
  • Image or clone the drive before performing sensitive operations

Disclaimer

Recovering the partition table

Boot in Lubuntu (you have internet, right?) and Ctrl+Alt+T (opens the Terminal) and install testdisk and GParted.

sudo apt update && sudo apt install testdisk gparted -y

Go in testdisk, you’re working with the GPT partition table (if not, this guide won’t work, stop using this guide right now), start scanning (if you get nothing, deep scan till you get something), select the drives you need (preferably only the partition containing Windows) and list them as primary partition (once you select it, it will be in beautiful green) and write the partition table to disk, then exit.

Go to GParted and realign the drives in such a manner, that there is a 512MiB FAT32 partition at the start of the drive followed by whatever you want. At this point, you can also verify that the partition table is what you expected it to be. You may additionally run fsck or ntfsfix if you feel like.

Recreating the EFI partition

Boot into Windows 10 Setup, go to the Command Prompt and enter diskpart

list disk
sel disk 0 # Presuming Disk 0 is the intended drive
sel part 1 # Presuming Part 1 is the FAT32 partition
del part override
sel disk 0 # See first remark
create partition efi size=512 offset=1 # That's why I asked you to double check in GParted, otherwise this won't work
sel part 1 # See second remark
format fs=fat32 quick label="System"
assign letter=Z: # Change the letter if it errors out
sel part 2 # Presuming Part 2 of Disk 0 hosts Windows
assign letter=C: # Change the letter if it errors out
exit

Okay, we’re done creating our ESP (EFI System Partition) as Windows likes to call it, let’s actually get the firmware onto it

# Change Z: and C: depending on what you did previously
cd /d Z: 
bcdboot C:\windows /s Z: /f UEFI

Yeah, that’s about it! :)