1

When my computer is installed with a single system Windows 10, the boot loader is UEFI Bios and it is featured with a lot of functions such as changing the default GPU while booting. After I have Ubuntu installed, the boot loaded changes to grub. I am just wondering how can I switch between these two boot loader?

5

It's important to understand the difference between two different tools:

  • Boot loaders are programs that load an OS kernel into memory and pass control to the kernel. These are usually OS-specific, so you must use the Windows boot loader to boot Windows and a Linux boot loader (such as ELILO, GRUB, or the EFI stub loader) to boot Linux.
  • Boot managers present menus or command lines that enable you to launch particular boot loaders or other boot-related programs. A program that functions exclusively as a boot manager does not directly launch an OS kernel, although the boot loader it launches will do so.

This distinction is pretty simple and easy to understand, but there are some complicating factors that can make the difference seem rather blurry:

  • Some programs, including GRUB, are both boot loaders and boot managers. GRUB presents a menu of options, like a boot manager; but it can also directly boot a Linux kernel. GRUB, however, cannot directly launch a Windows kernel, so to boot Windows, GRUB passes control on to the Windows boot loader. The Windows boot loader can also function as a boot manager, but it's more often configured to boot straight to Windows, so this functionality is less important -- at least, when people set things up as Linux users generally do. (Windows tools like EasyBCD can help configure the Winddows boot loader's boot manager features, but I'm not very familiar with this tool myself. My understanding is that it's still nearly useless on EFI-based computers.)
  • Since version 3.3.0, the Linux kernel has included a feature, called the EFI stub loader, that turns it into its own boot loader. Thus, a boot manager (like rEFInd or gummiboot/systemd-boot) can start looking a lot like a combination boot manager/boot loader, in that the boot manager launches the kernel. The critical difference is that the boot manager launches the kernel by using EFI system calls, as if the kernel were a boot loader -- which it technically is.

Another issue to keep in mind is that the EFI spec includes a minimal boot manager, which is built into the firmware, not stored on disk. This functionality can be configured from Linux with the efibootmgr tool or from Windows with bcdedit or the third-party EasyUEFI. Unfortunately, the EFI spec includes NO guidance on what sort of user interfaces its boot manager should present. Thus, one computer may have a fairly decent user experience for its boot manager, but another may be hideous to the point of unusability. Furthermore, some EFIs have bugs that cause them to forget or ignore their boot manager configurations.

Now, to get to your question, it's not clear what tool was providing the functionality that has disappeared -- it could be the computer's built-in boot manager, the Windows boot loader, or something installed as a custom boot manager by the manufacturer. Ordinarily, the Windows boot loader presents few or no options, although it can be configured to show a menu with some options. If you can still boot to Windows from GRUB, though, that is done via the Windows boot loader, so if it was the Windows boot loader that was showing these options, I'd expect they'd still be available to you -- but after you select Windows from GRUB. (OTOH, maybe installing Linux has caused the Windows boot loader to adjust its options in a way you don't want.)

Sometimes adding a boot entry (via efibootmgr) causes a computer's firmware to drop other entries or otherwise adjust its operation. If this is the cause of your problem, you'll have to contact the manufacturer or (probably better) ask about it on a manufacturer-specific forum, since you were seeing features that are idiosyncratic to your computer. Unfortunately, manufacturer customer support about this is usually abysmal, but if you poke around in this direction, you may find something. The solution, if there is one, is likely to be to access the computer's built-in boot manager, which can usually be done by hitting Esc, Enter, or a function key early in the boot process. (There's no standardization about how to do this.)

If the functionality you saw came from a manufacturer-specific boot program, it may be possible to add it to the GRUB menu; but you'll need to track down the EFI program that provides that functionality and add it to the menu manually or by using something like GRUB Customizer. Alternatively, my own rEFInd might automatically pick up the manufacturer's boot loader and present it as a menu option, but I can't promise that. You can look for likely programs on the EFI System Partition (ESP), which is normally mounted at /boot/efi in Ubuntu. EFI programs usually have .efi extensions, so you can look for those. Note that many manufacturers also provide their own ESP-like partitions on which they store EFI tools and configuration files, but these partitions may not be automatically mounted in Ubuntu. You'll need to use a disk utility like parted to locate them, then mount them in your file manager or using mount.

|improve this answer|||||
2

There are a number of tools that allow you to switch up your efi boot loaders.

I should could also mention here for more background information, there is a special partition on your hard drive that is formatted with a fat32 file system and is usually 128mb but sometimes bigger. It hold all of your UEFI boot configuration and loaders. Find it like this (on linux with parted):

$ sudo parted 
(parted) print all
Model: ATA SanDisk Ultra II (scsi)
Disk /dev/sda: 480GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name                          Flags
 1      1049kB  1087MB  1086MB  ntfs         Basic data partition          diag
 2      1087MB  1360MB  273MB   fat32        EFI System Partition          boot, esp
 3      1360MB  1494MB  134MB                Microsoft reserved partition  msftres
 4      1494MB  190GB   189GB   ntfs         Basic data partition          msftdata
 8      190GB   349GB   158GB   ext4         LinuxHome
...
(parted)

You can use this info to mount the UEFI partition: /dev/sda2

For lots of detail check out Ubuntu's Community Wiki entry for it: https://help.ubuntu.com/community/UEFI

|improve this answer|||||
  • I am not understanding. What I was using is a fancy Asus UEFI Booting graphic interface, which I think is the default boot loader by Windows? After the installation of Ubuntu, what I got is grub, and there is nothing more than a few options with Ubuntu. – xxx222 Aug 19 '16 at 9:27
  • I have used that same fancy Asus UEFI boot manager. You can switch which one "activates" when your computer turns on with that efibootmgr command. Its just kind of intimidating, be careful. The rEFInd tool I mentioned is another one... which isn't the answer to your question but might work for you and it's a good start for playing with this UEFI stuff. The actual answer to your question is the efibootmgr command. Follow that link I included there. askubuntu.com/questions/485261/… – Layton Everson Aug 19 '16 at 9:38
  • Does BootOrder mean the priority of the boot manager? I thought it is the order for different systems (Windows, Linux). – xxx222 Aug 19 '16 at 9:49
  • Yes. Each of your systems (Windows 10, Linux, and even Asus's bios) has its own boot loader. One of them takes priority and engages the others when you select the option in their menu... i.e. grub2 launches the same boot loader that was being launched before you installed grub2. grub2 just gave itself top priority when you installed it so its being loaded first. You can pass a parameter to the efibootmgr command to list all your options as well as change the order. – Layton Everson Aug 19 '16 at 9:59
  • I just found that I can't run efibootmgr as it told me "EFI variables are not supported on this system. " – xxx222 Aug 19 '16 at 10:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.