Looking for a way to install a couple of operative systems in a laptop compatible with UEFI I need to found how to change the default boot operative system selected for UEFI, or in other words how to change the order of the default entries of boot options in UEFI so it starts Ubuntu instead Windows (i.e).

All of this started with the installation of each operative system, each of them will create an special partition between 300 – 500 MB which will act for file system for UEFI (In my case after installing Ubuntu it was /dev/sda/1) . If you mounted that partition probably you’ve found this file system hierarchy:

Inside the /ubuntu directory we will find:

Those files are important because they contain instructions on «how to load the operative system» in this case «Ubuntu» and where it is located «which partition» among other information.

We need to backup the ubuntu directory under EFI and proceed to install the next operative system:

In this case I’ve installed Clonezilla (by decompressing it directly on the partition). Don’t get confused about the other directories, you are only interested on /boot (clonezilla although it could be Debian, Lubuntu or even Windows) and /ubuntu.

Clonezilla in an utility to backup/restore hard drives and partitions. Really usefull, actually it’s like a tiny o.s that loads a kernel with many utilities so we’ll treat it like one.

The thing is, after decompressing Clonezilla the UEFI boot process always starts Ubuntu, so how to modify that behavior?

Changing which Operative system to load by default with UEFI

The first thing we need is a CLI (a command line interface like bash) and the efibootmgr utility, fortunately for me Clonezilla has both things! You could also use an ubuntu live or other tool that has efibootmgr, I’ve started Clonezilla from a pendrive. I highly recommend reading the answer given here which describes other ways to do this.

Executing efibootmgr without parameters shows this:

So Ubuntu is being loaded as Boot0010* ubuntu as first in the UEFI boot order: BootOrder: 0010,000A,000C, etc… And clonezilla it’s Boot000E* \EFI\boot\bootx64.efi

I don’t like the name given automatically by UEFI so I added the entry with a custom label:

The parameters are:

  • -v verbose
  • -c create
  • -L custom label
  • -l loader name

And now I have:

And to make Clonezilla boot by default we change the BootOrder with the switch -o (explicitly set BootOrder)

After restating the computer Clonezilla is being loaded as default.

Topics I’ve read for this post:

Ubuntu UEFI Install
Default UEFI Files
UEFI Install process
UEFI multiboot process
Clonezilla documentation
UEFI Files
Making UEFI boot specific operative system