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?
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
There are a number of tools that allow you to switch up your efi boot loaders.
efibootmgr... It's not very fun to use but the actual answer. http://manpages.ubuntu.com/manpages/xenial/man8/efibootmgr.8.html (Switch the boot order, answered here: Change boot order using efibootmgr)
rEFIndis my favorite. http://www.rodsbooks.com/refind/ This one allows you to easily set up custom looking boot loader displays and is somewhat easy to configure.
grub2will also let you manage this but it's not as intuitive as rEFIND is. Tons of resources for this here: https://help.ubuntu.com/community/UEFIBooting
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
$ 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:
For lots of detail check out Ubuntu's Community Wiki entry for it: https://help.ubuntu.com/community/UEFI