Recover windows 10 installation without removing ubuntu

9,347

Your /dev/sda use the Master Boot Record (MBR) partitioning system. Unless you've got a second hard disk that uses the newer GUID Partition Table (GPT) system, this means that Windows is installed in BIOS/CSM/legacy mode, since Windows ties its boot mode to its partition table type -- on MBR disks, Windows installs and boots only in BIOS mode, and on GPT disks, Windows installs and boots only in EFI/UEFI mode.

It sounds like you may have forced Ubuntu to install in EFI mode. (Ubuntu is less restrictive about the linkage of boot mode to partition table type than is Windows.) If so, you've got an EFI-mode version of GRUB, which cannot launch the BIOS-mode Windows boot loader. Broadly speaking, there are three ways around this problem:

  • Install a BIOS-mode GRUB -- You can install the BIOS-mode version of GRUB on the disk and use it. Since this is a new installation, the easiest way to do this may be to re-install Ubuntu, but to do it in BIOS mode. This will require that you learn to control your boot mode. See this page of mine on the CSM for some information on this; but be aware that the page was written for people in the opposite situation to yours -- that is, with Windows installed in EFI mode and an Ubuntu installation (potentially) occurring in BIOS mode. Alternatively, you could run Boot Repair from a BIOS-mode boot of an Ubuntu emergency disk. Either way, you'll need to learn to control the boot mode.
  • Convert Windows to boot in EFI mode -- The new Microsoft MBR2GPT tool can do this; or you can follow an older procedure like this one. If you go this route, you'll probably need to re-install an EFI version of GRUB by using Boot Repair, or install my rEFInd boot manager on the computer.
  • Use a mixed-mode boot -- It's possible, but awkward, to boot one OS in EFI mode and another in BIOS mode. The most direct way to do this is to use the computer's built-in boot manager to switch boot modes. How this is done varies from one computer to another, though. Typically, you access the boot manager by hitting Esc, Enter, or a function key soon after you turn on the computer. You may have used this boot manager to tell the computer to boot the Ubuntu installer. Another alternative is to use my rEFInd; but you'll need to edit refind.conf: Uncomment the scanfor line and ensure that hdbios is among the options. This will enable BIOS boot support in rEFInd, whereupon it should produce a gray diamond-shaped icon that should boot the computer in BIOS mode, in addition to its default EFI-mode boot option(s), which should boot Ubuntu.

Of these options, the first one is the least elegant in the long term, as my page on the CSM (referenced earlier) describes; but it's relatively low in risk. If I were doing a fresh installation, I'd recommend doing everything in EFI mode, but converting Windows to boot in that way carries some not-insignificant risks, so I'm reluctant to recommend doing that. Using a mixed-mode boot is likely to be the short term, but it's also likely to be the most awkward, particularly if you rely on the computer's built-in boot manager. Overall, it's hard to make a simple recommendation of which approach to use, since that depends on your specific needs, skills, and situation.

Share:
9,347

Related videos on Youtube

user1450832
Author by

user1450832

Updated on September 18, 2022

Comments

  • user1450832
    user1450832 over 1 year

    I had Windows 10 installed on my machine. I created an extra partition and installed ubuntu on it. During installation I was getting error that grub installation failed. To fix that I choose an 500MB partition (I am guess this was MBR) to mount on /boot/efi and proceeded with installation. This fixed installation however, grub is not able to detect Windows 10.

    Here is my system partiton: enter image description here

    /dev/sda1 is the partition I chose to mount on /boot/efi. /dev/sda2 is Windows 10 installation. /dev/sda6 is Ubuntu.

    When I am running sudo update-grub grub is not detecting Windows 10 installation. I am worried that if I just randomly follow any blog post I may or may not lose my Windows 10 install. Can someone please explain me what happened and point me in the direction on how to fix it.

    • ravery
      ravery almost 7 years
      sda1 should be flagged ESP partition not boot. was this partition originally there? did the installer format it?
    • Lew Rockwell Fan
      Lew Rockwell Fan almost 7 years
      Don't know about 10 specifically, but some (all?) recent Windows versions use 2 partitions. Most stuff is on the second one, but I think the W bootloader is put in the first one, i.e., sda1. Looks like you wiped that out. I'm surprised by the size of it though. I'd expect it to be much smaller, so maybe I'm wrong. If that is the problem though, I suspect you'll need to boot with your Windows installer disk and choose some sort of repair option. If you want to be extra careful, you might clonezilla sda2 and backup your data before you do anything else.
    • user1450832
      user1450832 almost 7 years
      @ravery Yes the partition was originally there. I guess you are right sda1 should be flagged ESP partition. It is showing boot because I chose it to be boot during Ubuntu install. Yes, installer formatted it during installation.
    • user1450832
      user1450832 almost 7 years
      @LewRockwellFan I think I can follow pureinfotech.com/repair-master-boot-record-mbr-windows-10 to repair Windows boot installation. However I am not sure how to recover Ubuntu after doing these steps. Any suggestion?