Ubuntu – Refind configuration: Change boot order and default boot

bootrefinduefi

I installed REfind and it works great! It immediately Windows and Ubuntu options and put them in a nice menu to choose from when I boot the computer.

However, I found the configuration instructions intimidating and a little beyond my grasp.

The first option is Windows and Windows loads if nothing is selected for 20 seconds. I would like for Ubuntu to be the default that loads if nothing is selected. Also, the first option for Ubuntu is the grub menu. There are two more options after that, that appear to be for two versions of Ubuntu.

I would pick the first one instinctively, because it appears to be the most recent version. But my concern is, will I have to change this every time I get an updated version of Ubuntu from software updates?

I tried changing this from efi boot manager in ubuntu terminal but it didn't change the order in refind.

Best Answer

First, you can set the default boot option in rEFInd by editing the default_selection item in refind.conf (usually in the /boot/efi/EFI/refind directory in Linux). Set any relevant subset of the text that appears when you highlight the option in the menu to make it the default. In your case, default_selection vmlinuz will probably work nicely.

Second, the "two versions of Ubuntu" to which you refer are almost certainly two different Linux kernels. The kernel is not Ubuntu, but it is the core ("kernel") of the OS, and in a technical sense, it's the part of Ubuntu that is Linux -- it's the Linux kernel (as opposed to a FreeBSD kernel, an OS X kernel, or whatnot). In any event, rEFInd is coded in such a way that all the files within a directory are sorted by date within the rEFInd menu, with the most recent file first. Thus, when you install a new kernel package, rEFInd will automatically move it to the start of the list.

This sorting interacts with the default you set in that when you set a default that matches more than one entry (as vmlinuz will if you've got multiple Linux kernels), rEFInd uses the first item in the list as the default. Thus, rEFInd should normally boot the most recent kernel by default if you set default_selection vmlinuz in refind.conf. (There can be exceptions to this rule if you mess with the date stamps by using the touch command in Linux or if you install kernels in a strange order.)

As rEFInd's designer, I created this system to work sensibly with most Linux distributions, provided a reasonable default_selection is set. Sorting by date stamps, in particular, helps a lot with this.

Related Question