0

Sorry in advance if its duplicate, I did googled a lot but cant find exactly my problem and I'm fairly new to Ubuntu

Long story short: I made a dual boot of WINDOWS10 and UBUNTU16, all worked fine until I tried to reinstall the UBUNTU part.. I somehow ruined the boot loading, I finally made it to reinstall UBUNTU but no sign for the windows10 side(grub menu at boot got only ubuntu)

what do I need to do ?

Along the reinstall I tried to be as careful as possible not to touch the windows partitions at all (sda2 and sda3 in picture below)

my_grub2_status

I did try to fix with grub2 , I pasted the output here, it does state on windows 7 or 8 (but i had 10..) but not letting me access or boot to it.

jack onsl
  • 3
  • 1
  • 3
  • 1
    You have your EFI partition inside the extended partition -- that's something I've never seen before. You say you had Windows 10, so on an MSDOS disk, must be in legacy mode. Probably installed Ubuntu in a different mode (UEFI) and not legacy like Windows. – ubfan1 Jul 30 '17 at 21:42
  • Just to add on to the info imfo ubfan.When you installed two version with UEFI and legacy, there is no way to solve this but reinstalling both to the same system (either UEFI or Legacy). If you had windows first, you could try to install Ubuntu in the same mode again. – CatMan Jul 31 '17 at 00:45
  • how you know from this picture whats legacy and whats UEFI? – jack onsl Jul 31 '17 at 03:23
  • will it work if ill delete all the lines beside the 2 windows paritions(my important stuff is there..!) and reinstall ubuntu in legacy mode ? – jack onsl Jul 31 '17 at 03:24

1 Answers1

1

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:

  1. 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.
  2. Boot the Ubuntu installer in BIOS mode into its "try before installing" option.
  3. 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:

  1. 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.
  2. 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.

Rod Smith
  • 44,284
  • 7
  • 63
  • 105
  • wow @Rod Smith thanks alot for your answer!! what you wrote in the begin is exactly what happended to me, But i got some good and bad news, good news is that somehow it has been FIXED without me reinstall anything !! bad news is that i'm not sure what fixed it .. i did tried boot repair and fix with gparted but not sure at all what fixed it – jack onsl Aug 02 '17 at 04:06
  • your explaination really fit to my situation and i feel that turning to all legacy mode is the right way togo here, but cant be positive sure what nailed it ... any screenshots of my current situation i can post to make it clear what fixed it? both ubuntu and win10 appear in my grub boot menu and booting normally – jack onsl Aug 02 '17 at 04:14
  • ps. for now i marked it as right answer as it fit exactly to my situation even if its not what i did at last, hope its ok, anyway thanks alot – jack onsl Aug 02 '17 at 04:15
  • See here for information on determining your boot mode in both Windows and Ubuntu. If both are in BIOS/CSM/legacy mode, as I expect, then you can pretty much forget it for now. Chances are Boot Repair is what fixed it; if my understanding of the problem is correct, then it's unlikely that GParted alone could have done anything useful. – Rod Smith Aug 02 '17 at 17:44