I can't be 100% positive, but it looks like you have a BIOS/CSM/legacy-mode install of Windows on an MBR disk, then installed Ubuntu in BIOS/CSM/legacy mode, and this worked fine. When you re-installed Ubuntu, though, it appears that you booted the installer in EFI/UEFI mode, which caused it to create, or prompted you to create, an EFI System Partition (ESP; your /dev/sda5
). If the system then booted into the EFI-mode GRUB, it would be unable to redirect to the BIOS-mode Windows. Note that some of this is speculative, but this is consistent with your system's current state -- namely, traces of both BIOS-mode and EFI-mode GRUB, no EFI-mode Windows boot loader, and the partition table in MBR form.
In any event, there are several ways to recover. None is guaranteed to work, and all carry some risk. Therefore, I strongly recommend that you back up your personal data and be prepared to completely re-install and restore everything. I also recommend that you read my Web page on the Compatibility Support Module (CSM). That page is written for people in a different situation than yours, but the background information on what the CSM is and why it can create problems will help you understand your current predicament. In any event, your options include:
Revert to 100% BIOS-mode Booting
If you delete or bypass the EFI-mode GRUB on /dev/sda5
and re-install a BIOS-mode GRUB, your problem should go away. The broad outline of how to do this is as follows:
- Delete
/dev/sda5
, or at least erase GRUB from it. This step isn't really required, but it will remove one possible boot path that you don't want for this solution.
- Boot the Ubuntu installer in BIOS mode into its "try before installing" option.
- Run Boot Repair.
The tricky part to this task is step #2. You must be able to control your boot mode for this process to work. My page on the CSM, referenced earlier, provides information on this. In most cases, you can control the boot mode of an emergency disk by selecting the correct entry from the computer's built-in boot manager menu. External media often have two entries, one of which includes the string "UEFI" and the other of which does not. Picking the "UEFI" entry boots in EFI mode and picking the other entry boots in BIOS mode. At least, that's the way it should work -- sometimes computers take these commands as suggestions, and sometimes boot media may lack one or the other boot loader, which throws a monkey wrench into the works.
Install rEFInd
My rEFInd boot manager, unlike GRUB, can usually redirect from an EFI-mode boot to a BIOS-mode boot. Thus, rEFInd may be able to get your existing Windows installation to boot in BIOS mode, while keeping Ubuntu booting in EFI mode. To do this, you would:
- Install rEFInd. You can do this most easily from Ubuntu with the PPA or Debian package. Alternatively, you could use the USB flash drive version if you want to try this without making permanent changes to your computer.
- Edit
refind.conf
(likely in /boot/efi/EFI/refind
after you install rEFInd but before you reboot; or in EFI/refind
on the USB flash drive if you test using that version): Uncomment the scanfor
line and ensure that hdbios
is among the options.
With any luck, when you reboot rEFInd will appear and give you various boot options, including at least one (probably two) for Ubuntu and a gray diamond-shaped icon that will, with any luck, boot Windows.
Convert Windows to EFI-mode Booting
The Microsoft MBR2GPT tool is supposed to be able to convert Windows booting in BIOS mode on an MBR disk to boot in EFI mode, converting the disk to GPT. If successful, you'd then have both Windows and Ubuntu installed in EFI mode. That said, there are a number of caveats to this approach:
- I've never used this tool, so I can't say how well it would work from personal experience.
- Further to the above, Microsoft's tool was probably designed to convert a Windows-only system. I'd guess that the odds of it objecting to your dual-boot configuration -- or worse, of doing it serious damage -- are significant. OTOH, my concerns may be overblown; I've seen no actual discussion of this issue from anybody who's actually tried the tool on a multi-boot computer.
- Even if the conversion is successful, the computer will probably end up booting straight to Windows. This may be correctable using EasyUEFI, or in a worst-case scenario, Boot Repair. (You'd need to ensure that Boot Repair runs in EFI mode, though, not in BIOS mode as when reverting to BIOS-mode booting.)
Overall, I'd say this is a "bleeding-edge" sort of solution, and you should try it only if you're very willing to fall back on the next option....
Re-install Everything
You can wipe the disk clean and re-install both Windows and Ubuntu. If you do so, I recommend you re-install both OSes in EFI mode. That's the native mode for most computers these days (those sold prior to late 2011 are mostly BIOS-based, those sold in late 2011 or later are usually EFI-based). As described on my CSM page, adding BIOS-mode boot support to an EFI-based computer complicates the boot path and increases the risk of problems.
Of course, you'll need to back up and restore your personal files if you take this approach. If they're mostly isolated to one partition (it looks like /dev/sda3
may fit this bill, but that's unclear), then you could preserve that partition while deleting everything else -- but there's always a risk that something will go wrong and wipe it out, so you should not count on this as a backup. Also, as your partition table is currently in MBR form and EFI-mode booting of Windows more-or-less requires the disk use GPT, you'll need to convert from MBR to GPT, and most tools delete all partitions when doing such a conversion. My GPT fdisk (gdisk
, cgdisk
, and sgdisk
) tool, which is a standard part of Ubuntu, can do a conversion while preserving existing partitions, so if you want to re-install in EFI mode but preserve one or more partitions, you can use gdisk
for that part of the task. See this page for details.
Incidentally, the occasional need to do a complete OS re-install is one reason I like having a separate /home
partition in Ubuntu. OTOH, if most of your personal files reside on NTFS so they can be shared across OSes, it may not be worth reconfiguring Ubuntu in this way.
Summary
Overall, reverting to 100% BIOS-mode booting is likely the easiest choice in the short run; converting to 100% EFI-mode booting (via MBR2GPT
or by a complete re-install) is likely the best choice in the long run; and using rEFInd to switch boot modes on the fly is a sort of compromise.