Strange problems setting up Ubuntu and Linux Mint side by side on an UEFI laptop

I tried installing Ubuntu 16.04 and Linux Mint 18 on separate partitions of a hard drive, with two other partitions to be mounted as /boot (one for each). The idea was to have the two systems completely independent and to select between them through the laptop's UEFI boot menu. I was also hoping to be able to make each boot loader see the other one. In the future I planned to add yet another distribution.

The first thing that seems to be out of order is that the installers of both Ubuntu and Mint asked me where to install the boot loaders, despite that Ubuntu's community documentation says:

Note that in a UEFI-mode installation, Ubuntu will not ask you where to install the boot loader. If it does, or if it complains about the lack of a BIOS Boot Partition, you've probably accidentally booted in BIOS/CSM/legacy mode.

(I am pretty sure that I was booted in UEFI-mode: "Launch CSM" was disabled in UEFI setup, and at the end the installed systems were mounting EFI system partition under /boot/efi.)

As I had to choose where to install the boot loaders, I selected them to be installed to respective /boot partitions.

After installing Ubuntu, it showed up in UEFI boot menu. Inspecting the ESP (EFI system partition), I found that a directory /EFI/ubuntu was created. With help of efibootmgr, I determined that the startup file for Ubuntu was \EFI\UBUNTU\SHIMX64.EFI. (In fact, the first time I tried installing Ubuntu, I selected "do not use this partition" for ESP, but it was used nonetheless.)

Afterwards I installed Mint, and what happened was that "ubuntu" item in UEFI boot menu started launching Mint's GRUB instead of Ubuntu's GRUB, and I found no way to start Ubuntu anymore. It turned out that Mint had overwritten the /EFI/ubuntu directory on ESP with its own files.

My main problem is still ahead.

I have figured out that if I reinstall Mint's GRUB with the following command

sudo grub-install --efi-directory=/boot/efi --bootloader-id=linux-mint 

it will create a EFI/linux-mint directory with its startup "kernels." Here is the contents of this directory after the above operation:

$ sudo ls -l /boot/efi/EFI/linux-mint total 3546 -rwx------ 1 root root     121 juil. 28 22:05 grub.cfg -rwx------ 1 root root 1067896 juil. 28 22:05 grubx64.efi -rwx------ 1 root root 1271672 juil. 28 22:05 MokManager.efi -rwx------ 1 root root 1289424 juil. 28 22:05 shimx64.efi 

Through UEFI setup, I added "linux-mint" boot option pointing to /EFI/linux-mint/shimx64.efi, and it worked. (I regret now not having removed /EFI/ubuntu directory first for a cleaner experiment).

I reinstalled Ubuntu, and it recreated its /EFI/ubuntu:

$ sudo ls -l /boot/efi/EFI/ubuntu total 3610 drwx------ 2 root root    1024 juil. 28 22:23 fw -rwx------ 1 root root   64352 juil. 28 22:23 fwupx64.efi -rwx------ 1 root root     121 juil. 28 22:25 grub.cfg -rwx------ 1 root root 1067896 juil. 28 22:25 grubx64.efi -rwx------ 1 root root 1271672 juil. 28 22:25 MokManager.efi -rwx------ 1 root root 1289424 juil. 28 22:25 shimx64.efi 

In UEFI boot menu, "ubuntu" entry appeared automatically together with the "manually" created before "linux-mint". The "ubuntu" entry launched Ubuntu's GRUB, as expected. I inspected the UEFI boot menu with efibootmgr -v and checked that "ubuntu" was pointing to \EFI\UBUNTU\SHIMX64.EFI and "linux-mint" was pointing to \EFI\LINUX-MINT\SHIMX64.EFI.

I selected "linux-mint" from UEFI boot menu, and it launched Ubuntu's GRUB. Please help me.


Category: dual boot Time: 2016-07-29 Views: 1

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 0.128 (s). 12 q(s)