0

I was on Windows 10. I installed Fedora 25 disto. My goal was to establish a dual-boot configuration. Unfortunately, I did not know anything about the difference between LEGACY (MBR) and UEFI (GPT) boot mode. So I made mistakes. After Linux installation, GRUB was installed as a LEGACY boot loader, and I lost the access to Windows 10 boot loader in UEFI boot mode.

First, I tried to fix the boot loader without reinstalling Windows 10. By editing 40_custom GRUB script, I was able to regenerate grub.cfg file to show a Windows 10 item in GRUB boot menu. But it does not work, when I selected the item I had a Windows boot manager error message mentionning c:/bcd/boot. At this time I was not aware of the fact that my Windows 10 was probably only accessible via UEFI boot mode.

So then, I booted in UEFI mode (secure boot disabled), I reinstalled Windows 10 with manual partitionning. But I still cannot reach Windows 10 neither UEFI mode nor LEGACY (GRUB is still the LEGACY boot loader). It's strange. I used diskpart tool and I saw the classical Windows partitions: System, MSR, Windows, Recovery, but also an EFI partition (formatted FAT32). I checked that my HDD uses GPT via diskpart. How can I fix UEFI booting and setup a stable Windows/Linux dual-boot? I precise that I have personnal data on a NTFS partition located near the end of my HDD and at this time I have no way to backup.

My hardware is a laptop MSI GE62 2QC Apache.

  • "Maybe EFI partition has been removed." - Was it remove? You must answer this question beofre anyone can answer your quesiton. Use the parition manager tool of your choice to verify if the EFI was deleted. – Ramhound Apr 3 '17 at 17:38
  • @Ramhound I wrote that I can see the EFI partition with diskpart. Please read the entire post. – Ant0nin Apr 3 '17 at 17:42
  • If you can see the EFI partition with diskpart, then the partition was not removed, so clarify your question. If you have an EFI partition on an MBR disk, then you will be unable to boot to Windows, until its GPT. So you need to, edit your question, after you veriy if your disk is using MBR or GPT. You should edit your question and clarify these points. You not being sure of something is the different betwen advice that results in you losing all your data and us helping you solve your problem without data loss. – Ramhound Apr 3 '17 at 17:45
  • @Ramhound Thank you for your help. I checked that my HDD uses GPT via diskpart. I updated my question as you suggest. – Ant0nin Apr 3 '17 at 18:03
0

It's almost always best to install all OSes in the same boot mode (BIOS/CSM/legacy vs. EFI/UEFI). Given your starting condition of Windows booting in EFI mode, your best bet was to install Fedora in EFI mode, too. This is fairly easy to do with most systems, but there are some pitfalls. Common mistakes at this point include:

  • Enabling the CSM -- This complicates the boot path, as described on this page of mine. The result is often a mixed-mode installation, such as you describe -- Windows booting in EFI mode and Linux in BIOS mode.
  • Improper USB drive preparation -- It's possible to take a .iso image file for installing Linux and create a USB drive that lacks the BIOS or EFI boot loader. If it lacks the EFI boot loader, it will be impossible to boot it in EFI mode, and most Linux distributions will then install in BIOS mode if the disk can be booted in that mode. This problem goes hand-in-hand with the preceding one -- if the CSM is not enabled, an improperly-prepared USB drive won't boot; and in this case, users often enable the CSM, either because they discover through trial and error that this works to get the installation medium booting or because they follow poor instructions on the Internet to do this. As noted, though, enabling the CSM is a mistake; the proper solution to an inability to boot the medium is to discover why it's not booting and fix the medium. (In rare cases, disabling Secure Boot is necessary.)

Given your current configuration, your best bet is to install an EFI boot loader for Linux. There are several ways to do this, such as:

  • Boot Repair -- The Boot Repair tool may be able to install GRUB in EFI mode semi-automatically; however, this tool is primarily intended for Ubuntu and related distributions. I'm not sure how it would respond to Fedora. Also, to install EFI-mode GRUB, it must be run from an EFI-mode boot. Thus, you'll have to master your boot-mode options.
  • rEFInd -- My rEFInd boot manager can be helpful. You can download the USB flash drive or CD-R image of rEFInd and boot with it. If this is successful, you'll probably be able to boot your current Fedora installation in EFI mode. From that, you can install the rEFInd RPM or install the EFI version of GRUB.
  • Manual installation -- Several EFI boot loaders for Linux are available, as described on this page of mine. Any of them can be installed manually by copying their files to the ESP and then using efibootmgr or a similar tool to register them with the EFI. (See my EFI boot loader installation page for the procedure, in general outline.) Note that this procedure requires booting Linux in EFI mode, at least to do it properly. (A Linux emergency disk works fine for this; or you may be able to use rEFInd to boot your existing Fedora installation in EFI mode.)
  • Re-install Fedora -- You can delete the current Fedora installation and try again. (You can delete it by deleting its partitions or by creating fresh filesystems on them. DO NOT delete or create a fresh filesystem on the ESP, though.) Since you've presumably done very little with your new Fedora installation, this may be easier than trying to fix the current setup. As with most of the preceding options, doing this right requires mastering control over the computer's boot mode; if you boot the installer in BIOS mode, the installation will be in that mode and you'll be back where you started.

As further background, I recommend you read Adam Williamson's blog entry on how EFI works and my page on installing Linux on EFI systems. Both provide background information that you'll find helpful in understanding the situation and avoiding the sort of mistakes you've made. You should also read my page on the CSM, referenced earlier.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.