0

After using lubuntu on my laptop for quite a while, I decided to upgrade my desktop as well. I have windows 7 on /dev/sda and I installed debian on /dev/sdc. When I installed debian, I looked for window's efi partition (/dev/sda1) , and I installed grub there. Everything was fine.

A few days later, I decided to go from debian to kubuntu. Following the installer from a live usb, I chose 'use whole disk' and I overwrote /dev/sdc with kubuntu. At this point, booting from /dev/sda would go to grub-rescue, and from /dev/sdc would skip grub altogether, as it only had one entry.

The way I went from debian to kubuntu was probably not the best way. I repaired windows boot using a windows USB, and I enabled grub on /dev/sdc.

Now that both systems were fine, I tried update grub to detect windows but to no avail. I tried the grub-config program too and I looked through some questions here but nothing worked with me.

I am aware of my limitations and that I got to this point simply because of bad decisions. I can boot into windows but it's not convenient, I have to manually select its disk on the boot menu. I'd like to have it in grub too. Any suggestions?

I ran boot-repair from a live usb and here's the output

  • What's the difference between doing it on a live CD and on ubuntu? – Luís Alves Feb 17 '19 at 15:50
  • 1
    Welcome to AskUbuntu! The difference? Perhaps nothing, perhaps the difference between success and failure. The idea here is to avoid the unknown (I.E. the current status of your Kubuntu installation.) By using live media we can utilize a known functional OS to accomplish the task. You'll find many questions here where the original poster is asked by some helpful member, "Do you get the same results booting from live media?" – Elder Geek Feb 17 '19 at 17:36
  • Alright, I totally see what you mean. I'll give it a try this afternoon and report back. – Luís Alves Feb 19 '19 at 12:45
  • Ok, so running boot-repair on a live usb gave me this error:

    "GPT detected. Please create a BIOS-Boot partition (>1MB, unformatted filesystem, bios_grub flag). This can be performed via tools such as Gparted. Then try again. Alternatively, you can retry after activating the [Separate /boot/efi partition:] option."

    I'm not really sure what to do with this information. I'm not comfortable messing with the advanced settings either. What do you think? Here's the output too http://paste.ubuntu.com/p/vbZPzdP5ry/

    – Luís Alves Feb 19 '19 at 21:57
  • One way to become comfortable with advanced settings is to have a good backup. That way when something unexpected occurs you can always roll back and things are no worse. This is just plain best practice. A quick glance at your paste bin (which you should really [edit] into your question) tells me that your EFI partition is on /dev/sdc1 on your Kingston A400 SSD. If I were in your shoes I would backup that ~120GB SSD and then "retry after activating the [Separate /boot/efi partition:] option" – Elder Geek Feb 20 '19 at 15:24
  • You might also find this useful – Elder Geek Feb 20 '19 at 19:54
  • From your linked post, I now see my mistake. I used the existing EFI partition in the Windows drive instead of creating a new one. I don't understand how Windows booted until I uninstalled Debian, though. Maybe I'm misremembering, I only had Debian for a day and I night have not even tried booting Windows. Anyway, I was messing around with boot-repair and now Windows doesn't boot again, I'll have to wait for the weekend to retrieve a larger flash drive so I can repair it with the Windows installer. I assume Windows needs to be perfect before I can try anything else. – Luís Alves Feb 21 '19 at 10:34
  • 1
    Not creating a new EFI partition may not be the smoking gun. I did, when creating a dual-boot dual-disk system, but the installer ignored it and used the existing one that was also used by Windows. My system works fine regardless. – Organic Marble Feb 21 '19 at 13:04
  • I got it to work and I posted it as an answer. Thank you very much for your help and guidance. – Luís Alves Feb 25 '19 at 21:56

1 Answers1

0

I managed to find a solution. Apparently, a UEFI system can't detect a BIOS system. What I suspect happened was that when I installed debian, the installer detected that windows was installed as BIOS legacy mode, and installed itself as BIOS too. Then, when I uninstalled debian, windows boot got corrupted, and there was nothing for the kubuntu installer to detect, so it was installed as UEFI. Later I fixed windows, leaving me with two incompatible OSs. Take that with a grain of salt, it's just my interpretation of the situation.

The solution I found is here.

Note: Even though I have windows 7, when I ran the commands as the linked solution states from a windows 7 installer, the last step failed (bcdboot c:\windows /s s: /f UEFI). The /f option was not recognized. I re-ran everything through a windows 10 installer command line and it worked perfectly.