0

I tried to install 18.04 Ubuntu unsuccessfully twice and then formatted and installed 17.10. Windows 10 is on the separate SSD while the ubuntu disk looks like this:

sda:

  • [sda1 Ubuntu root and boot 100 GB]
  • [unallocated space 400 GB]
  • [sda2 NTFS data rest of the disk]

After whole installation adventure grub shows 17.10 ubuntu on sda1 and some kind of dos on sda2, while there is nothing on sda2 except data. Choosing this option leads to prompt asking to disconnect all drives without OS on them and Ctrl+Alt+Del to restart.

Booting through bios directly to windows boot loader or SSD disk with windows leads directly to grub, so no way to boot into windows.

Here is boot info: http://paste.ubuntu.com/p/g2wBYm77qk/ It seems to correctly see that windows actually on sdb1.

Os-prober too sees that nonexistent dos OS, but fails to detect actual windows 10.

How do I restore windows boot and add it to grub?

  • You have older BIOS with MBR(msdos) partitioning. Since main partition of Windows is first partition of sdb, it probably had its boot partition of 100MB with two essential boot files in it on sda, now gone. Separate boot partition is not required & you can repair sdb1 to directly boot Windows. First add boot flag to sdb1. Then use a Windows repair tool to run full set of repairs. You are missing BCD & bootmgr which need to be added to sdb1. It will not run repairs without boot flag. May be best to disconnect sda so Windows does not try to use it. – oldfred Apr 25 '18 at 03:44
  • @oldfred so how do I add boot flag? As you may read in the comment to the Paul Benson's answer I tried booting sdb1 separately but it wouldn't. – Virgileo Apr 25 '18 at 17:15
  • Probably easiest to use gparted and right click, set boot flag on. You can use Disks, command line, and in Windows, its command line set active on after selecting drive & partition. Your Windows will not boot without adding the missing two boot files bootmgr & BCD which you should be able to fix with Windows repairs, but it will not even repair it without boot flag. – oldfred Apr 25 '18 at 19:37
  • Well adding bootable flag changed nothing. You keep mentioning some kind of repair - what is it? Is it built in win 10 feature or do I need some kind of external software? – Virgileo Apr 25 '18 at 20:24
  • That said if you mean windows 10 installation USB drive, I don't currently have large enough drive to put it on, though I have win8 DVD, would it suffice? – Virgileo Apr 25 '18 at 20:34

1 Answers1

0

The info is useful but points to a to a bodge, regarding important mounting points and a possible BIOS config issue. You do need to know what you're doing when it comes to setting up Ubuntu, let alone a dual boot. The some kind of DOS on sda2 suggests you have an MBR disk and that partition points to your data file, not your W10 system so that shouldn't even be in there as a GRUB option.

For now I'd concentrate on getting Windows back. Power down, disconnect your HDD (the one with Ubuntu on it), then start up and see if W10 will boot. If it doesn't then your MBR and maybe your BCD file are messed up. Both can be repaired externally without the need for a re-install, but that's another subject. Meanwhile I suggest have a good read of this first before attempting another dual boot installation.

Paul Benson
  • 1,022
  • So I tried to boot only sdb and in the boot menu there were three related entries: ssd itself, win bootloader and ubuntu (?) - all of them leading to the following prompt: "Reboot and Select proper Boot device or Insert Boot Media in selected Boot device and press a key" The comment by oldfred advises to add boot flag to the sdb, should I do it or something else? – Virgileo Apr 25 '18 at 14:42
  • Did you install Ubuntu from a UFD?? If so, plug it in. Restart (go into BIOS boot manager again) and reboot from UFD.. Select Try Ubuntu and boot into live Ubuntu. Open terminal then type following: sudo apt-get repository ppa:yannubuntu/boot-repair. When that's finished type sudo apt-get update then sudo apt-get install boot-repair. Follow instructions then Restart computer. – Paul Benson Apr 25 '18 at 18:14
  • So i did that, here is output: image, boot-info

    It did remove weird stuff like dos OS thingy, but no windows to be seen.

    – Virgileo Apr 25 '18 at 20:05
  • I also tried adding boot flag to sdb as was advised by @oldfred but it changed nothing. Booting from windows boot loader and from sdb directly just leads to grub with lonely ubuntu there. – Virgileo Apr 25 '18 at 20:27
  • But can you boot into Ubuntu yet on sda?I see Windows option is missing from grub.cfg. Did you try as suggested and disconnect sda drive and then try to boot up Windows separately from BIOS boot menu? Other than re-installing W10, it sounds like you are going to have to repair your BCD and maybe your MBR on sdb. – Paul Benson Apr 25 '18 at 21:44
  • Well yeah i can boot into ubuntu just fine, booting with sda disconnected gives the prompt to get proper boot device connected, though I haven't tried doing it again after the boot-repair. Should I?

    Also how do I repair my BCD and MBR? Do I need a windows 10 installation media for that?

    – Virgileo Apr 25 '18 at 22:08
  • the boot flag is required by the Windows repair console. You have to use your Windows repair flash drive and its repair console or your Windows installer if it has repair console. This is not a Windows forum. If you really need help with Windows best to use a Windows forum. – oldfred Apr 25 '18 at 22:22
  • Looking at your print-out grub2 has been installed in the MBRs of both sda and sdb, whereas it should only have installed on sda. So as I suggested earlier your MBR on the Windows disk needs to be fixed and probably BCD file needs to be rebuilt as well. If you have W10 installation it has a repair option which can do this automatically. Otherwise this might be of help. If no installation disk you will need a bootable repair disk. I'm afraid doing this with W10 is a lot more awkward than with earlier Windows editions. – Paul Benson Apr 26 '18 at 02:25
  • So I tried to do the windows repair, but didn't work, I decided to reinstall it, would I be fine if I install it on sdb with sda disconnected and then connecting sdb and doing grub repair? – Virgileo Apr 26 '18 at 15:47
  • To re-install Windows you don't need to disconnect sda. I only asked to do that last time to see if you could boot up Windows from BIOS as sdb 1st boot, but clearly you could not as sdb's MBR was corrupted. Install Windows on sdb after formatting it NTFS, and make sure you cab activate it. Once done try booting up from sdb (sdb 1st in boot order). If all goes well download all your drivers and updates. Do not try to involve Ubuntu or touch GRUB at all. This will likely take you several hours to complete so let us know how you get on. – Paul Benson Apr 26 '18 at 17:17
  • Ok I installed windows on sdb (I did it before reading your comment so sda was disconnected), updated, installed drivers. Connected sda and windows continues to boot just fine. Should I boot Ubuntu and grub update or something? – Virgileo Apr 26 '18 at 19:14
  • When you say you installed drivers, you've installed your chipset , graphics, audio and all system drivers?? If you go to device manager (devmgmt.msc) are any question marks seen against any device or controller. Have you installed all Windows updates as well, because that usually takes a few hours to do from a basic Windows System? – Paul Benson Apr 26 '18 at 20:39
  • Yep, installed everything, no question marks. Well I started like an hour before your comment popped up so I had more than enough time – Virgileo Apr 26 '18 at 20:41
  • OK. install Macrium Reflect. What you will do is take an image of W10 which you will keep on an external drive (UFD or HDD). The image will take up about 15-20 GB but will save you having to ever re-install Windows, updates (so far) or drivers again. You can also image Ubuntu. MR also has facilities to repair your MBR and a lot of other useful commands. You'll also need a MR Rescue CD/UFD. Once you've installed MR you can make one from there by burning to a blank CD, or extracting files to a UFD. This needs to be done first. – Paul Benson Apr 26 '18 at 21:03
  • Hold on, why do I need to do this? Aren't all the MBR and bootloaders are fine now? – Virgileo Apr 26 '18 at 21:09
  • Shouldn't I be able to do it like this from this point on? After all I have installed windows with ubuntu drive physically disconnected. – Virgileo Apr 26 '18 at 21:17
  • For the time being they are.You can try this by all means, and please let us know if it works. But one is always advised to install Windows first. What I suggested was a precaution in case you ever mess up Windows or Ubuntu again. It's a standby and it works very well for me. – Paul Benson Apr 26 '18 at 22:02
  • Ok, set bios to boot from sda, booted into ubuntu, quick sudo update-grub and all working great. Thanks for help and the back-up tip, I'll look into it. – Virgileo Apr 28 '18 at 11:46
  • You're welcome. Don't forget to make a Macrium Reflect Recovery disk/UDF and to make a W10 image to store externally with it. It will dig you out of a hole in minutes should your W10 ever get screwed up again. – Paul Benson Apr 28 '18 at 20:01