Adding a new OS to Grub

While maintaining my current Linux 32-bit install, I wanted to be able to use a Linux 64-bit version, and also have a windows version.
So I bought a second SSD, and installed Windows, which booted just fine from the second drive. Then I installed an Ubuntu distribution that not only failed to install GRUB it broke the Windows loader. I repaired the loader, and tried again. Same result.

First insight: use the existing GRUB loader

My first insight: instead of installing GRUB on my new drive, I could use the version of GRUB on my old drive and have it add the new operating system to the list of choices.
This reduced my problem to find a way to edit the GRUB configuration so that it knew about the other operating systems.
I found lots of documentation on this, but it was all horribly complex. So I went back to first principles, and read a detailed GRUB tutorial.

Second Insight: run os-prober

The documentation described, among many other things, a GRUB script, os-prober, that looks for new operating systems on available drives, and will add them to the GRUB configuration automatically. This reduced my problem to: how do you run os-prober

Final Light Bulb

Then, I saw it. I didn’t have to do something special to run os-prober. I had to do something special to not run it. It runs automatically when you run update-grub.
So I ran it. And suddenly it was there!

Comments

Popular Posts