Multi-Boot: Windows 10, Manjaro Linux, Clear Linux. Can Clear Linux be added to GRUB2?

Hi there,
I just wiped FreeBSD from my system and installed a copy of the latest version of Clear Linux instead. It was a bit tricky getting the partitions correct by advanced installation, but it did complete successfully. However, on reboot GRUB2 still loads with Windows 10 and Manjaro Linux, and no Clear Linux. I can boot into both Windows 10 and Manjaro just fine, and am hoping I can simply add an entry to custom_40 for Clear Linux.

Is this possible? Can GRUB2 boot Clear Linux? I have updated grub from within Manjaro, and os-prober does detect the correct install path and name of Clear Linux, but it does not add an entry automatically.

What is the best way to triple boot these three systems with the least frustration?

Thank you,
Stephen

(Here is a copy of my current fdisk read-out. The order is Windows, Manjaro, Clear Linux.)

Device Start End Sectors Size Type
/dev/sda1 2048 923647 921600 450M Windows recovery environment
/dev/sda2 923648 1128447 204800 100M EFI System
/dev/sda3 1128448 1161215 32768 16M Microsoft reserved
/dev/sda4 1161216 279279615 278118400 132.6G Microsoft basic data
/dev/sda5 441071616 441362431 290816 142M EFI System
/dev/sda6 441362432 441864191 501760 245M Linux swap
/dev/sda7 497672192 498184191 512000 250M Linux swap
/dev/sda8 307951616 441071615 133120000 63.5G Linux filesystem
/dev/sda9 442376192 497672191 55296000 26.4G Linux root (x86-64)

1 Like

Hi @sonofhan, welcome to the Clear Linux forum.

Have you had a chance to review our documentation for booting into multiple OSes?

https://docs.01.org/clearlinux/latest/tutorials/multi-boot/dual-boot-linux.html

-and-

https://docs.01.org/clearlinux/latest/tutorials/multi-boot/multi-boot.html

The first document will most likely be what you are wanting to do since you already have another GRUB-based OS installed.

1 Like

Hi Tom,

Thank you for the quick reply. I did review both documents during installation and they were helpful, but I believe I’ve found myself in a bit of a grey area. In the document for booting alongside another GRUB-based OS, I ran into an issue at step 8: "Share the existing EFI system partition by designating as such. Right-click the EFI System Partition (e.g., /dev/sda1) and select Name Partition."

I was able to to edit the partition name of the Manjaro’s EFI partition [/dev/sda5] to CLR_BOOT without issue, but after closing GParted and clicking back into the installer, it did not recognize the change I had made, and displayed a message along the lines of: “! CLR_BOOT not found”. After re-trying multiple times with the same result, I instead renamed [/dev/sda2] to CLR_BOOT, which is Windows 10’s EFI partition.

After applying that change and re-launching the installer, it was able to recognize CLR_BOOT without issue and allowed me to continue with the installation. To be sure this is what was happening, I tried switching back to editing [/dev/sda5] to CLR_BOOT and returning [/dev/sda2] to its original name, then launching the installer again, and I was presented with the same error message as before.

The installation went smoothly after returning to what worked, but after completing and rebooting, I still have my original setup of GRUB2 with Manjaro and Windows 10.

How would you go about setting up a way to choose between all three installed operating systems? Can it be done with Manjaro’s GRUB2?

Thank you again,
Stephen

1 Like

@sonofhan, You’ve just went outside of my knowledge on this by making the windows efi the CLR_BOOT partition, I wouldn’t do that! For this to work, you ultimately need to keep the original GRUB boot sequence as is and then add the systemd boot manager (the Clear Linux boot manager) to control them all. @bun.k.tan, can you help here?

1 Like

Can you go into your UEFI boot manager after installing Clear Linux and selecting the Clear Linux UEFI boot partition? If you can do that then there should be a path to use systemd boot. I’m wondering if the UEFI firmware is seeing the first GPT boot partition and just blindly booting to it. By doing the boot menu selection you are overriding the default action.

1 Like

Greetings @sonofhan!
Do you want to use GRUB as your bootloader?
Or can you use systemd-boot and chain-boot GRUB instead? Chain-booting GRUB is easier.
But if your requirement is that you must use GRUB, I can document that for you.

2 Likes

@TomL I can boot into GRUB no problem, but it only has Windows 10 and Manjaro. I’m thinking there must be a way to add Clear as an entry.

@bun.k.tan

Hello!

It would be great to use my existing GRUB as bootloader since Windows and Manjaro are currently booting normally. I’m a little anxious that I’ll break that somehow, I have a tendency to break things. :slight_smile: But I’m up for either option. The funny this is “os-prober” does recognize Clear Linux, it just doesn’t add an entry to GRUB.

We’ll get you where you need to go. Bun is the expert on this (he wrote the tutorials!). Since your GRUB menu is working correctly we’ll need to chain that into the systemd boot menu, similar to what is described here: https://docs.01.org/clearlinux/latest/tutorials/multi-boot/dual-boot-linux.html#make-systemd-boot-default-bootloader-and-chain-boot-grub and then you’ll be able to boot to any OS you have set up. I’ve actually never tried this before but look forward to checking it out. It will most likely be tomorrow before we can give you a definitive answer though…sorry about that.

2 Likes

@sonofhan - here’s the solution to booting Clear Linux via GRUB.

Essentially, we will use GRUB to chain-boot systemd-boot (the bootloader that Clear Linux uses).

To do that, follow these steps:

  1. Boot up to Manjaro (in your case)

  2. Log in

  3. sudoedit /etc/grub.d/40_custom and add a menuentry like the example below:

    #!/bin/sh
    exec tail -n +3 $0
    # This file provides an easy way to add custom menu entries. Simply type the
    # menu entries you want to add after this comment. Be careful not to change
    # the 'exec tail' line above.

    menuentry 'Clear Linux OS' {
        search --fs-uuid --no-floppy --set=root 309E-F4AF
        chainloader (${root})/EFI/org.clearlinux/bootloaderx64.efi
    } 

You can find the EFI partition’s UUID for --set=root (my example is 309E-F4AF) by running sudo blkid.

  1. Update GRUB
    sudo update-grub
  1. Reboot

NOTE: By default, Clear Linux sets the bootloader timeout to 0 so you won’t see the systemd-boot menu. If you want to see the menu, set a timeout as follows:

  1. Boot up to Clear Linux

  2. Log in

  3. Set a timeout (for example):

    sudo clr-boot-manager set-timeout 20
    sudo clr-boot-manager update

Currently, the side-effect of running sudo clr-boot-manager update right now is that it will make systemd-boot the default bootloader and not GRUB. To revert back to GRUB, just set the EFI boot order using sudo efibootmgr --bootorder XXXX,XXXX where XXXX is the boot ID. Here’s an example:

clear@clrlinux~ $ efibootmgr
BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0002,000C,000D,0001,0004,0005,0006,0008,0009,000A,000B,0007,0000
Boot0000* ubuntu
Boot0001* Linux Boot Manager
Boot0002* Linux bootloader                         <<<<----- Clear Linux
Boot0004* Linux Boot Manager
Boot0005* Linux bootloader
Boot0006* UEFI : USB : General UDisk 5.00 : PART 0 : OS Bootloader
Boot0007* manjaro                                  <<<<------ Manjaro
Boot0008* Linux bootloader
Boot0009* Linux bootloader
Boot000A* Windows Boot Manager
Boot000B* Linux bootloader
Boot000C* UEFI : LAN : PXE IP4 Intel(R) Ethernet Connection (6) I219-V
Boot000D* UEFI : LAN : PXE IP6 Intel(R) Ethernet Connection (6) I219-V

clear@clrlinux~ $ sudo efibootmgr --bootorder 0007,0002

We are going to add an option for clr-boot-manager update to not touch the EFI boot order. But for the time being, this is the workaround.

4 Likes

@bun.k.tan @TomL

Hey guys,

I just had a chance to implement your solution and sure enough, it works like a charm. :slight_smile: I’m writing to you from within Clear Linux and am able to boot all of my operating systems without issue. Thank you for taking the time to help me out with this and draw up some documentation. I can’t tell you how impressed I am with the support I’ve received, and I hope this is helpful to someone else in the community.

Cheers,
Stephen Hanson

3 Likes

@sonofhan, so glad it worked out and you are able to experience Clear Linux in your environment.


router@inspi:~$ sudo lsblk -f
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
sda
├─sda1 vfat FAT32 BOOT 2075-636C 754.6M 6% /boot/efi
├─sda2 ext4 1.0 e8cccb83-4a92-4e68-88c8-ff602d86f944 35.8G 21% /
├─sda3
├─sda4 ntfs AA927C2D927BFFDD
├─sda5 ntfs router_data 4416017316016770 121.4G 56% /home/android/router/4416017316016770
└─sda6 ext4 1.0 root 1f5258b1-e5de-4cc6-b004-fe8b86981af9 48.2G 12% /media/root/root

my sda6 contains clearlinux, sda2 has kubuntu, sda4 windows 10, sda1 has EFI fat.
i tried above steps , still there is no boot into clearlinux.
i tried copying EFI from sda1 to sda6 in “/boot/efi”


i went with manual load in grub>
set root=(hd0,gpt6)
linux /boot/efi/EFI/…

it failed