Ask Your Question
1

Restore windows 10 uefi files in Fedora 25

asked 2016-12-15 05:22:31 -0500

beppe gravatar image

I made a fresh install of Fedora 25 in order to upgrade from Fedora 24. I was expecting as usual to find the dual boot entry for Windows 10 but it is not there: as a matter of facts there is no windows file in /boot/efi . I think that the problem is that I may have mistakenly I reformatted the /boot/efi partition (bad of me). I can access the windows partition and the uefi files that are in Windows/System32/Boot/ but I do not know how to restore them in grub so that the dual boot entry appears at the boot. Can you help me?

Thank you in advance

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2017-08-22 10:04:28 -0500

beppe gravatar image

I answer my own question. First of all thanks @cmurf but it did not work. I did not have Windows booting back after I followed your instructions. I found a much easier, though brutal way:

  1. Download a windows 10 installation media from here https://www.microsoft.com/software-do...

    1. Boot by the installation media

    2. Choose language and when it says Install now, on the lower left is an option Repair your computer, pick that. Pick the Troubleshoot

    3. Pick the option to repair the booting problems

Now the laptop booted with the old Windows but Fedora desappeared. You can still boot in Fedora by choosing it in the boot menu of your laptop or restore the grub booter. To did the latter I used a rather brutal solution: I reinstalled Fedora from scratch (no harm for me since I have /home and /usr/local on different partition and there I have all my valuable data)

Hope it helps

edit flag offensive delete link more
2

answered 2016-12-15 12:08:20 -0500

cmurf gravatar image

Yet another betrayal of the user by the installer...

Windows startup repair can't repair this. But there is another way. First you need Windows install media, either optical or USB, and boot from it. At the Windows Setup screen choose language, and then at the next screen that says Install now, on the lower left is an option Repair your computer, pick that. Pick the Troubleshoot > Advanced options > Command prompt options.

And then you can pop over to this blog and pick up where it has all the CLI stuff, starting with 'diskpart'

https://blog.d0zingcat.xyz/2015/09/28...

I just intentionally broke Windows 10 in a VM by formatting the ESP, and I ran through all of these commands and now Windows 10 should boot.

You'll need to figure out how to get to the firmware boot manager (computer model specific F key, for me it's F9 on an HP and F12 on Intel NUC... I think) and you might have to dig around in there to find the Fedora bootloader. Every firmware boot manager UI is different so you just have to go exploring and hopefully get it booted. If not, you'll have to boot from Fedora install media.

Once you've booted Fedora you need to find the efibootmgr command used to write the bootloader location in NVRAM so Fedora will boot by default. You could actually do this first, before starting the Windows 10 bootloader restore project.

grep efibootmgr /var/log/anaconda/program.log

That path is for the root volume, so if you've used a live cd you'll have to mount root fs to get to that path. That'll show the efibootmgr command that you need to issue. One change is you need to use two forward slashes instead of one to specify the path to shim.efi.

edit flag offensive delete link more

Comments

@cmurf, this is not a "betrayal" of the user by the installer.

If you booted to a "DOS floppy disk" and typed format c: and it asks you "are you sure?" and you press "y" would you consider your own actions a "betrayal" by some other irresponsible entity?

Perhaps the question is better phrased in the context of a game show: "Would you like to see what is behind door number 1?" "Would you like to see what is behind door number 2?" or "Would you like CONTROL ALL OF THE DOORS?"

lovepump gravatar imagelovepump ( 2016-12-15 20:53:43 -0500 )edit

GUI installer vs DOS floppy disk is apples and oranges. The installer shouldn't even be showing the user the EFI System partition. It's not a user domain partition, it's installer and firmware domain. The Windows and macOS GUI installer and partition tools hide the EFI System partition for exactly this reason, and on those platforms users don't ever inadvertently delete it. Problem solved. But the Fedora installer betrays the user by enabling them to nerf the bootloader for an OS they aren't deleting.

cmurf gravatar imagecmurf ( 2016-12-16 12:51:54 -0500 )edit

cmurf, thanks for posting this solution. I made the same mistake as beppe, and your advice worked in my case. The blog entry you linked to is gone now, but a copy is saved on the internet archive. In my case, I had to recreate the \EFI\Microsoft\Boot\ directory before following step 2 of the instructions on the blog. After following the blog instructions, there was no need to configure the BIOS to boot into Fedora. My problem instead was that the GRUB menu still did not provide an option to boot into Windows. I fixed this with GRUB Customizer (Fedora package name: grub-customizer).

Canon8088 gravatar imageCanon8088 ( 2017-12-16 17:58:49 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2016-12-15 05:22:31 -0500

Seen: 3,988 times

Last updated: Aug 22 '17