In following the modularity of Linux, we will look at the Bootloader.
A Bootloader is software that the hardware loads the Linux kernel into memory.
The system Bootloader is the bridge between the hardware powering up and the Operating System (OS) taking over.
NOTE: If you continue with installing any of these Bootloaders, you need to disable Secure Boot in your UEFI settings.
There are two folders to be aware of for Bootloaders. The Boot folder is where the actual kernel and initramfs, or the file system that contains the drivers and tools needed to load the Root system of the OS, usually '/boot'. The ESP (EFI System Partition) is the location of the Bootloaders to load from UEFI firmware, or usually '/boot/efi'.
BIOS or UEFI
Before we get started with the Bootloaders, we need to cover the Basic Input/Output System (BIOS) or the Unified Extensible Firmware Interface (UEFI).
BIOS is the way older systems loaded the OS. There are limitations to the BIOS system:
Let's look at some Bootloaders:
To start, we need elevated privileges:
Since every Bootloader we plan to use uses UEFI, we can install a utility to let us check on the EFI. We need to install 'efivar':
For Ubuntu:
For Red Hat systems:
For Arch:
We can then run a command to verify that GRUB is installed if we are using a default installation:
There should be quite a few lines printed. If you get lines printed out, then your system is using UEFI, but if an error is the only output, then you are using BIOS.
NOTE: Before using these on a live system, try the instructions out on a virtual system. If needed, you can copy an existing system to a virtual machine and try it out that way. Changing the Bootloader can cause issues if you do not do it correctly. Testing is the best way to learn to do this.
rEFInd
The 'rEFInd' Bootloader is mainly for UEFI, butit runs on a BIOS system as well. It is best to use a UEFI system and one that does not have the '/boot' partition, or partition containing the '/boot' folder, formatted as XFS.
If your BOOT folder is on a partition that is formatted as XFS, the Bootloader does not natively have the ability to read the format. CentOS has a default setting of using XFS on the BOOT partition. When you install CentOS, you may want to change it to another format.
The 'rEFInd' boot menu is in Figure 1, which is running on CentOS 9.
FIGURE 1
To install 'rEFInd' on Ubuntu, you'll need to use a PPA to install it, so use the commands:
Before restarting, we need to make a few changes, which we will cover after we go over installing 'rEFInd' for other distros. The configuration is the same for all the distros.
For Fedora to install the 'rEFInd' Bootloader, use:
For CentOS, you need to go to 'https://sourceforge.net/projects/refind' and select 'Files' from the tabbed list. Here, select the newest version available, which should be at the top of the list. Now, find the 'RPM' file in the list that is not a source (src) file. For example, when I wrote this article, the current file was 'refind-0.14.2-1.x86_64.rpm'.
NOTE: Use the command 'lsblk -f' to verify the format of your '/boot' partition to see if it is XFS. If it is, do not continue with 'rEFInd'. Use another Bootloader.
Click on the file and download it. Open a terminal and change the current directory to '~/Downloads/', if this is your default save folder for downloads. Run the command, changing the filename as needed:
To install 'rEFInd' on Arch Linux, use the command:
Now that we have it installed on whichever distro you have, we can continue with the configuration.
To set 'rEFInd' as the default Bootloader, we need to run:
There should be a configuration file in the folder '/boot' called 'refind_linux.conf'. This file should not need to be changed. The important file is '/boot/EFI/refind/refind.conf', but on Ubuntu it is at '/boot/efi/EFI/refind/refind.conf'. You need to edit the file with elevated privileges and find the following three lines:
These lines will need to be uncommented and the two set to 'true':
To make the changes work to check for all kernels installed on the system, you can reissue the command 'refind-install'. It will not overwrite the configuration file you changed.
Save the file and exit the editor. You can reboot now to verify that the Bootloader works. Once you know that 'rEFInd' is working, you can remove the unused Bootloader.
Limine
For Limine to work, '/boot' must be FAT (12, 16 or 32). It usually defaults to FAT32 on most modern distros. If your '/boot' folder is not FAT, then Limine will not work. For most default installs of CentOS and Fedora, the /boot' folder is not a FAT format, so they will not work.
As I stated before, you can use the command 'lsblk -f' to get a list of your drives and the disk format used on each.
Do the following on all distros but Arch. Arch has its own installation procedure.
On your distro, open a web browser and go to the site 'https://github.com/limine-bootloader/limine/releases'. Here, you find the latest version, which should be at the top of the list. Each file is a different compression type followed by the file with the signature in it to verify the downloaded file.
Save the file and after it completes downloading, open the folder in a terminal. Use the following command to extract the file:
For Fedora, use the command:
You may need to change the filename if the version number has changed. Change directory to the folder it created, such as 'cd limine-9.5.2'.
For Ubuntu, you need to install a necessary file and create a file:
For Fedora, use the command:
For CentOS, use:
Once in the folder, you need to run the following commands to build the Bootloader:
Now, we should have a compiled version of 'limine' and installed as well.
For Ubuntu, do:
You can have separate entries for each kernel version.
For Arch, you can install the Bootloader with:
In this manner, it installs the 'BOOTX64.EFI'. You cannot use the file from GRUB; it must be its own file. If you use the file from GRUB, it will boot GRUB no matter what you do otherwise.
After it installs, you need to create the 'limine' folder:
Now, we need to copy the 'BOOTX64.EFI' into the newly made folder:
Next, we need to create our menu. The file is 'limine.conf' and will be in
'/boot'. The file will contain the following basic lines:
Be sure to place the UUID of the ROOT partition in place of the dashes. Do note that the slash in front of the menu item is there and is a colon for the other distros.
To remove Limine, you need to delete the 'limine' folders from the '/boot', '/boot/efi' and possibly '/boot/efi/EFI' or wherever you made folder and configuration files. The last step is to remove the entry from UEFI using the command 'efibootmgr'. When you run the command with no parameters, you get a list of available Bootloader entries. Find the one with 'limine' and note the number, such as '0005'. Once you have the number, you can delete the entry from the list with the command:
Be sure to change your boot number for Limine, since mine was '0005', but yours may be different.
You can also go back to the folder where you build the source files and run:
For Arch, remove the folders you created, the entry made by 'efibootmgr' and then uninstall it with:
GRUB
GRUB is one of the most widely used Bootloaders and most likely came installed on your distro. If not, or if you removed it, then we can install it.
For Ubuntu, you need to use the following command:
During the installation, it may prompt you for the disk to install GRUB onto, and if GRUB was on the system before, it might know and ask to update the remaining files.
After it is on the system, you need to install it where it needs to go. As mentioned previously, you need to find your ESP, which with Ubuntu is '/boot/efi'. So, run the following command:
Then we need to run the commands to create the configuration file:
Now, we need to get a few things set up to make sure GRUB loads properly. Since you are installing GRUB, which is the default Bootloader, we can assume that it was uninstalled at some point and another Bootloader is running. So, run 'efibootmgr' and look for the entry with 'shimx64.efi'. On my system it was '0002'. But, looking at the Boot Order, entry '0004' was first. Knowing the entry that must be first, and also seeing the existing order, we need to rearrange the entries so that GRUB is first.
Let us assume that GRUB is '0002' and the Boot Order is '0004,0002,0005,0003,0000,0001'. We need the Boot Order to be '0002,0004,0005,0003,0000,0001'. The command would be:
We need to look at the default options by editing the file at '/etc/default/grub' with your favorite editor.
Once in the file, you need to change 'GRUB_TIMEOUT=0' to a value such as '5' or '10' so the menu will appear for a bit. Then the line 'DEFAULT_TIMEOUT_STYLE=hidden' needs to be changed to 'menu'. Save and exit the file. The changes you made need to be set in the GRUB configuration, so run the command to update it all:
When you reboot, you’ll see GRUB. Now you can safely remove the other Bootloader if you wish.
To install GRUB on Fedora or CentOS, use the command:
Next, you will need to perform the install, but you will get an error to make sure that Secure Boot is disabled. You may need to check this and then use the '--force' parameter.
NOTE: Change the 'booloader-id' to 'centos' for CentOS and 'fedora' when installing Fedora.
You then need to generate the configuration files:
Once it makes the configuration files, you need to populate the 'grub.cfg' file:
Check the 'efibootmgr' that the entry with 'grubx64' exists and is the first item as the default order. Change it as needed, check the boot timer as mentioned before and reboot. Fedora should start through the GRUB Bootloader.
For Arch Linux, you can install GRUB with:
Now, we need to install GRUB where it goes on the system:
Now, we need to create the configuration files and fill them:
Reboot, and the system should boot into a GRUB menu.
To remove GRUB, use the following commands on Ubuntu:
Be sure to change the boot order in 'efibootmgr' so GRUB is not the first on the list, and you may need to delete the GRUB (grubx64) entry. Make sure that the primary boot item in the order list is a valid Bootloader.
For Fedora and CentOS, use the following commands:
You may need to look at the EFI folder to see if the folder name is 'fedora'. This is the name created when installing it and specifying 'bootloader-id'.
For Arch Linux, you can remove GRUB with:
Then you can remove the folders that aren't needed:
Again, you may need to look in '/boot/efi' to check the folder. The name may be GRUB, but if you installed it, it is the name you gave it for 'bootloader-id'.
Remove the entry in 'efibootmgr' and change the boot order as needed before rebooting.
Conclusion
I hope you get an idea of the modularity of Linux and how you can replace different services with other services to make the system that suits your needs.
Keep in mind that some services allow for enhancements, such as adding images to a boot screen. This ability can let you change your Operating System to give you a better experience.
A Bootloader is software that the hardware loads the Linux kernel into memory.
The system Bootloader is the bridge between the hardware powering up and the Operating System (OS) taking over.
NOTE: If you continue with installing any of these Bootloaders, you need to disable Secure Boot in your UEFI settings.
There are two folders to be aware of for Bootloaders. The Boot folder is where the actual kernel and initramfs, or the file system that contains the drivers and tools needed to load the Root system of the OS, usually '/boot'. The ESP (EFI System Partition) is the location of the Bootloaders to load from UEFI firmware, or usually '/boot/efi'.
BIOS or UEFI
Before we get started with the Bootloaders, we need to cover the Basic Input/Output System (BIOS) or the Unified Extensible Firmware Interface (UEFI).
BIOS is the way older systems loaded the OS. There are limitations to the BIOS system:
- it is 16-bit
- uses the Master Boot Record (MBR), which is 32-bits
- is basic text, no mouse or network support
- allows for limited size of the disk drives (2.2 TB)
- lacks security features
- slow boot
- limited partitioning
- is 32- or 64-bit
- supports GPT and MBR
- allows for GUI, mouse and network before the OS loads
- has support for up to 8 ZB drives
- enhanced security in Secure Boot
- fast boot
- limited to 128 partitions per disk
Let's look at some Bootloaders:
- rEFInd (reFormatted EFI Indicator) - supports BIOS and, mainly, UEFI
- Limine - supports both BIOS and UEFI
- GRUB (GRand Unified Bootloader) - supports BIOS and UEFI
To start, we need elevated privileges:
Code:
sudo su
Since every Bootloader we plan to use uses UEFI, we can install a utility to let us check on the EFI. We need to install 'efivar':
For Ubuntu:
Code:
apt install efivar -y
For Red Hat systems:
Code:
yum install efivar -y
For Arch:
Code:
pacman -S efivar
We can then run a command to verify that GRUB is installed if we are using a default installation:
Code:
efivar -l
There should be quite a few lines printed. If you get lines printed out, then your system is using UEFI, but if an error is the only output, then you are using BIOS.
NOTE: Before using these on a live system, try the instructions out on a virtual system. If needed, you can copy an existing system to a virtual machine and try it out that way. Changing the Bootloader can cause issues if you do not do it correctly. Testing is the best way to learn to do this.
rEFInd
The 'rEFInd' Bootloader is mainly for UEFI, butit runs on a BIOS system as well. It is best to use a UEFI system and one that does not have the '/boot' partition, or partition containing the '/boot' folder, formatted as XFS.
If your BOOT folder is on a partition that is formatted as XFS, the Bootloader does not natively have the ability to read the format. CentOS has a default setting of using XFS on the BOOT partition. When you install CentOS, you may want to change it to another format.
The 'rEFInd' boot menu is in Figure 1, which is running on CentOS 9.
FIGURE 1
To install 'rEFInd' on Ubuntu, you'll need to use a PPA to install it, so use the commands:
Code:
sudo add-apt-repository ppa:rodsmith/refind
sudo apt install refind
Before restarting, we need to make a few changes, which we will cover after we go over installing 'rEFInd' for other distros. The configuration is the same for all the distros.
For Fedora to install the 'rEFInd' Bootloader, use:
Code:
sudo dnf install rEFInd
For CentOS, you need to go to 'https://sourceforge.net/projects/refind' and select 'Files' from the tabbed list. Here, select the newest version available, which should be at the top of the list. Now, find the 'RPM' file in the list that is not a source (src) file. For example, when I wrote this article, the current file was 'refind-0.14.2-1.x86_64.rpm'.
NOTE: Use the command 'lsblk -f' to verify the format of your '/boot' partition to see if it is XFS. If it is, do not continue with 'rEFInd'. Use another Bootloader.
Click on the file and download it. Open a terminal and change the current directory to '~/Downloads/', if this is your default save folder for downloads. Run the command, changing the filename as needed:
Code:
sudo dnf install refind-0.14.2-1.x86_64.rpm
To install 'rEFInd' on Arch Linux, use the command:
Code:
sudo pacman -S refind
Now that we have it installed on whichever distro you have, we can continue with the configuration.
To set 'rEFInd' as the default Bootloader, we need to run:
Code:
sudo refind-install
There should be a configuration file in the folder '/boot' called 'refind_linux.conf'. This file should not need to be changed. The important file is '/boot/EFI/refind/refind.conf', but on Ubuntu it is at '/boot/efi/EFI/refind/refind.conf'. You need to edit the file with elevated privileges and find the following three lines:
Code:
#fold_linux_kernels false
# linux_prefixed vmlinux, bzImage, kernel
# scan_all_linux_kernels false
These lines will need to be uncommented and the two set to 'true':
Code:
fold_linux_kernels true
linux_prefixed vmlinux, bzImage, kernel
scan_all_linux_kernels true
To make the changes work to check for all kernels installed on the system, you can reissue the command 'refind-install'. It will not overwrite the configuration file you changed.
Save the file and exit the editor. You can reboot now to verify that the Bootloader works. Once you know that 'rEFInd' is working, you can remove the unused Bootloader.
Limine
For Limine to work, '/boot' must be FAT (12, 16 or 32). It usually defaults to FAT32 on most modern distros. If your '/boot' folder is not FAT, then Limine will not work. For most default installs of CentOS and Fedora, the /boot' folder is not a FAT format, so they will not work.
As I stated before, you can use the command 'lsblk -f' to get a list of your drives and the disk format used on each.
Do the following on all distros but Arch. Arch has its own installation procedure.
On your distro, open a web browser and go to the site 'https://github.com/limine-bootloader/limine/releases'. Here, you find the latest version, which should be at the top of the list. Each file is a different compression type followed by the file with the signature in it to verify the downloaded file.
Save the file and after it completes downloading, open the folder in a terminal. Use the following command to extract the file:
Code:
tar -fvx limine-9.5.2.tar.xz
For Fedora, use the command:
Code:
tar -xf limine-9.5.2.tar.xz
You may need to change the filename if the version number has changed. Change directory to the folder it created, such as 'cd limine-9.5.2'.
For Ubuntu, you need to install a necessary file and create a file:
Code:
sudo apt install autoconf
touch timestamps
For Fedora, use the command:
Code:
sudo dnf install autoconf aclocal gcc
For CentOS, use:
Code:
sudo dnf install autoconf gcc automake
Once in the folder, you need to run the following commands to build the Bootloader:
Code:
autoreconf
./bootstrap
./configure
make
sudo make install
Now, we should have a compiled version of 'limine' and installed as well.
For Ubuntu, do:
Code:
cd /boot/efi/EFI
mkdir limine
cd limine
cp /boot/efi/EFI/BOOT/BOOTx64.EFI /boot/efi/EFI/limine/
sudo efibootmgr -c -d /dev/sda -L "Limine" -l "/EFI/limine/BOOTX64.EFI"
In my case, Fedora and CentOS would not work since the '/boot' partition is EXT4. If the partition was FAT, then it should work similarly to Ubuntu.
Switch to the '/boot' folder and create the file 'limine.cfg' and edit it. Add the following, you'll need to change version numbers for the kernel and the UUID of your ROOT partition:
[code] timeout: 10
remember_last_entry: yes
:Ubuntu-6.14.0-27
COMMENT=Boot Ubuntu
PROTOCOL=linux
KERNEL_PATH=boot:///vmlinuz-6.14.0-27-generic
MODULE_PATH=boot:///initrd.img-6.14.0-27-generic
KERNEL_CMDLINE=root=UUID=605bc5e2-f395-4ba5-837e-9550b808904d rw quiet splash
:Ubuntu-6.14.0-24
COMMENT=Boot Ubuntu
PROTOCOL=linux
KERNEL_PATH=boot:///vmlinuz-6.14.0-24-generic
MODULE_PATH=boot:///initrd.img-6.14.0-24-generic
KERNEL_CMDLINE=root=UUID=605bc5e2-f395-4ba5-837e-9550b808904d rw quiet splash
You can have separate entries for each kernel version.
For Arch, you can install the Bootloader with:
Code:
sudo pacman -S limine
In this manner, it installs the 'BOOTX64.EFI'. You cannot use the file from GRUB; it must be its own file. If you use the file from GRUB, it will boot GRUB no matter what you do otherwise.
After it installs, you need to create the 'limine' folder:
Code:
sudo mkdir /boot/EFI/limine
Now, we need to copy the 'BOOTX64.EFI' into the newly made folder:
Code:
sudo cp /usr/share/limine/BOOTX64.EFI /boot/EFI/limine/
Next, we need to create our menu. The file is 'limine.conf' and will be in
'/boot'. The file will contain the following basic lines:
Code:
timeout: 5
remember_last_entry: yes
/Arch Linux
protocol: linux
path: boot():/vmlinuz-linux
module-path: boot():/initramfs-linux.img
cmdline: root=UUID=----------------------------------- rw quiet splash
Be sure to place the UUID of the ROOT partition in place of the dashes. Do note that the slash in front of the menu item is there and is a colon for the other distros.
To remove Limine, you need to delete the 'limine' folders from the '/boot', '/boot/efi' and possibly '/boot/efi/EFI' or wherever you made folder and configuration files. The last step is to remove the entry from UEFI using the command 'efibootmgr'. When you run the command with no parameters, you get a list of available Bootloader entries. Find the one with 'limine' and note the number, such as '0005'. Once you have the number, you can delete the entry from the list with the command:
Code:
sudo efibootmgr -b 0005 -B
Be sure to change your boot number for Limine, since mine was '0005', but yours may be different.
You can also go back to the folder where you build the source files and run:
Code:
sudo make uninstall
For Arch, remove the folders you created, the entry made by 'efibootmgr' and then uninstall it with:
Code:
sudo pacman -Rsn limine
GRUB
GRUB is one of the most widely used Bootloaders and most likely came installed on your distro. If not, or if you removed it, then we can install it.
For Ubuntu, you need to use the following command:
Code:
sudo apt install grub-common grub2-common grub-efi-amd64 grub-pc-bin shim-signed -y
During the installation, it may prompt you for the disk to install GRUB onto, and if GRUB was on the system before, it might know and ask to update the remaining files.
After it is on the system, you need to install it where it needs to go. As mentioned previously, you need to find your ESP, which with Ubuntu is '/boot/efi'. So, run the following command:
Code:
sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ubuntu
Then we need to run the commands to create the configuration file:
Code:
sudo grub-mkconfig
Now, we need to get a few things set up to make sure GRUB loads properly. Since you are installing GRUB, which is the default Bootloader, we can assume that it was uninstalled at some point and another Bootloader is running. So, run 'efibootmgr' and look for the entry with 'shimx64.efi'. On my system it was '0002'. But, looking at the Boot Order, entry '0004' was first. Knowing the entry that must be first, and also seeing the existing order, we need to rearrange the entries so that GRUB is first.
Let us assume that GRUB is '0002' and the Boot Order is '0004,0002,0005,0003,0000,0001'. We need the Boot Order to be '0002,0004,0005,0003,0000,0001'. The command would be:
Code:
sudo efibootmgr -o 0002,0004,0005,0003,0000,0001
We need to look at the default options by editing the file at '/etc/default/grub' with your favorite editor.
Once in the file, you need to change 'GRUB_TIMEOUT=0' to a value such as '5' or '10' so the menu will appear for a bit. Then the line 'DEFAULT_TIMEOUT_STYLE=hidden' needs to be changed to 'menu'. Save and exit the file. The changes you made need to be set in the GRUB configuration, so run the command to update it all:
Code:
sudo update-grub
When you reboot, you’ll see GRUB. Now you can safely remove the other Bootloader if you wish.
To install GRUB on Fedora or CentOS, use the command:
Code:
sudo dnf install grub2-efi grub2-efi-modules shim grub2-efi-x64-modules
Next, you will need to perform the install, but you will get an error to make sure that Secure Boot is disabled. You may need to check this and then use the '--force' parameter.
Code:
sudo grub2-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=fedora --force
NOTE: Change the 'booloader-id' to 'centos' for CentOS and 'fedora' when installing Fedora.
You then need to generate the configuration files:
Code:
sudo grub2-mkconfig
Once it makes the configuration files, you need to populate the 'grub.cfg' file:
Code:
grub2-mkconfig -o /boot/grub2/grub.cfg
Check the 'efibootmgr' that the entry with 'grubx64' exists and is the first item as the default order. Change it as needed, check the boot timer as mentioned before and reboot. Fedora should start through the GRUB Bootloader.
For Arch Linux, you can install GRUB with:
Code:
sudo pacman -S grub grub-common
Now, we need to install GRUB where it goes on the system:
Code:
sudo grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=arch --force
Now, we need to create the configuration files and fill them:
Code:
sudo grub-mkconfig
grub-mkconfig -o /boot/grub2/grub.cfg
Reboot, and the system should boot into a GRUB menu.
To remove GRUB, use the following commands on Ubuntu:
Code:
sudo apt purge grub-efi-amd64-signed shim-signed grub-common grub2-common -y --allow-remove-essential
sudo apt autoremove
Be sure to change the boot order in 'efibootmgr' so GRUB is not the first on the list, and you may need to delete the GRUB (grubx64) entry. Make sure that the primary boot item in the order list is a valid Bootloader.
For Fedora and CentOS, use the following commands:
Code:
sudo rm -rf /boot/grub2
sudo rm -rf /boot/efi/EFI/fedora
You may need to look at the EFI folder to see if the folder name is 'fedora'. This is the name created when installing it and specifying 'bootloader-id'.
For Arch Linux, you can remove GRUB with:
Code:
sudo pacman -Rs grub
Then you can remove the folders that aren't needed:
Code:
sudo rm -rf /boot/grub
sudo rm -rf /boot/efi/arch
Again, you may need to look in '/boot/efi' to check the folder. The name may be GRUB, but if you installed it, it is the name you gave it for 'bootloader-id'.
Remove the entry in 'efibootmgr' and change the boot order as needed before rebooting.
Conclusion
I hope you get an idea of the modularity of Linux and how you can replace different services with other services to make the system that suits your needs.
Keep in mind that some services allow for enhancements, such as adding images to a boot screen. This ability can let you change your Operating System to give you a better experience.

