1

I'm attempting to load Windows 10 and two different installations of 16.04 LTS (with potentially other distributions in the future). I've installed Win10, 16.04 v1 and 16.04 v2, but when I run sudo update-grub only the installation of 16.04 v2 is detected and added to the boot.cfg file. Why isn't 16.04 v1 detected, and what's the simplest way to install multiple distributions of Linux such that they will be detected [by GRUB2]?

I've tried the following:

  • Add /boot as partition 1
  • Install Windows (using defaults)
  • Install Ubuntu v1 (selecting partition 4 as / and bootloader on /dev/sda)
  • Install Ubuntu v2 (selecting partition 5 as / and bootloader on /dev/sda)

This failed because I could only update grub successfully from Ubuntu v2, (partition 5) and I wanted to use Ubuntu v1 as the default install.

Then I tried:

  • Add /boot as partition 1
  • Install Windows (using defaults)
  • Install Ubuntu v1 (selecting partition 4 as / and bootloader on /dev/sda)
  • Install Ubuntu v2 (selecting partition 5 as / and bootloader on /dev/sda5)

This failed because now I can only update grub from Ubuntu v2 (partition 5), and it doesn't successfully detect the installation on partition 4.

All that being said, how can I install subsequent distributions (after the first Ubuntu install) and not have them gobble up the grub install? Did I mess something up when choosing where to put the bootloader during installation? (See below for detailed installation steps)


More details

Installation steps I used:

  1. Boot from Ubuntu Live USB (16.04.4 LTS).
  2. Using gparted, write new GPT to SSD and add boot partition (1GiB) to the start of the SSD. (Shutdown)
  3. Boot from Win10 Installation USB.
  4. Install Windows 10 (Pro 64bit, if it matters). (Shutdown)
  5. Boot into Ubuntu Live USB, selecting Try Ubuntu.
  6. Using gparted, adding partitions as follows:
    • (partition number, size, label)
    • 4, 50 GB, ubuntu1
    • 5, 20 GB, ubuntu2
    • 6, 33 GB, isos
    • ...(last), 9 GB, swap
  7. Install Ubuntu, selecting Something else and designating partition 4 for / of the first installation of Ubuntu.
    • The bootloader installs in the default spot on /dev/sda, over writing the windows bootloader. Remove installation media and shutdown.
  8. Boot Ubuntu v1 to make sure it works ... success. (Shutdown)
  9. Boot to Windows (selecting via GRUB at boot time) to make sure it works ... success. (Shutdown)

From here I've tried two different methods, both are failing...

Method 1

  1. Boot into Ubuntu Live USB, selecting Try Ubuntu.
  2. Click Install Ubuntu selecting Something else.
    • Designate partition 5 for / for this second installation of Ubuntu.
  3. Leave bootloader settings alone and install.

Result: Bootloader is associated with partition 5, not partition 4.

Method 2

  1. Boot into Ubuntu Live USB, selecting Try Ubuntu.
  2. Click Install Ubuntu selecting Something else.
    • Designate partition 5 for / for this second installation of Ubuntu.
  3. Tell bootloader to install to /dev/sda5 in hopes the MBR and current boot setup are left alone.

Result: Bootloader is associated with partition 5, not partition 4, and the ubuntu installation on partition 4 isn't detected during update-grub


Side note: Yes, I am using sudo update-grub when running update-grub. I've also tried sudo update-grub2 and gotten the same results.
This is a Dell XPS 13 9360 with UEFI, if it matters.

1 Answers1

0

I dont't known why grub not detected second ubuntu, but you can add custom config into grub config, in to file named custom:

$ ls /etc/grub.d/
00_header        10_linux      20_memtest86+  30_uefi-firmware  41_custom
05_debian_theme  20_linux_xen  30_os-prober   40_custom         README

Check whats added for ubuntu 1 in config(placed in /boot/), make same in 40_custom but with actual uuids for ubunti 2

Run sudo update-grub after making changes.

LeonidMew
  • 2,802