Linux slang explained: What is GRUB in Linux? | Linux China

thumbnail

Introduction: I'll tell you what GRUB is and what it's good for.                                   

The number of words in this article: 2751, the reading time is about 4 minutes

https://linux.cn/article-14427-1.html

His : Abhishek Prakash

Translator: Six out of the box

If you've ever used a Linux desktop, you must have seen this screen. This is called the GRUB screen. Yes, it's all capital letters.

Remember this screen? This is GRUB

In this chapter of the "Linux Jargon Buster" series, I'll tell you what GRUB is and what it's good for. Also, I'll briefly cover the configuration and customization section.

What is GRUB?

GRUB 🔗 www.gnu.org is a complete program for loading and managing system boots. It is the most common bootloader in Linux distributions. A bootloader is the first piece of software that runs when a computer starts up. It loads the kernel of the operating system 🔗 itsfoss.com , which in turn initializes the rest of the operating system (shell, display manager, desktop environment, etc.).

Bootloader and Boot Manager

I don't want to confuse you right now, but I think this topic is inevitable. There is a blurry line between the boot loader and the boot manager.

You already know what a bootloader is. It starts first, then loads the kernel into memory and executes it. The boot manager allows you to choose between different operating systems (if you have more than one operating system on your computer). The boot manager does not directly load the system.

With the release of Linux kernel version 3.3, the Linux kernel includes a built-in EFI bootloader 🔗 www.rodsbooks.com . In fact, any system that supports EFI includes an EFI bootloader 🔗 jdebp.eu . On systems that support EFI, the firmware reads the EFI file in the EFI System Partition (ESP) to obtain boot information.

Insert a picture here showing a partition table with ESP partitions:

GRUB is both a bootloader and a boot manager. I'll come back to GRUB in a moment. Let's first look at other GRUB-like programs.

> > Quick Fact : GRUB is an acronym for GR and Unified Bootloader . > > >

Quick Fact : GRUB is an acronym for GR and Unified Bootloader .

What do those lines on the GRUB screen mean?

You will see a few lines on the GRUB screen. These lines will be different for different setups, different distributions.

Typically, the first line is your Linux distribution. If you see something like advanced options, you can go into it and find some lines that start with "linux-generic-xyz" etc.

When your Linux distribution updates the kernel version, it keeps at least one older version. You can choose to boot into the old Linux kernel in case your system encounters any issues with the newly updated Linux kernel.

In Ubuntu-based distributions, you can also see a restore option.

Under advanced options there is usually an old kernel version and restore options

At the end, you may see an entry, such as System Settings or UEFI Settings, to access the system's BIOS settings.

What other boot managers are like GRUB?

GRUB is the most popular boot manager in Linux. But it's not the only one. There is a highly customizable boot manager called rEFInd Boot Manager 🔗 www.rodsbooks.com which is also loved by some Linux users.

Customized rEFInd Boot Manager screen | Image kofler.info/pop_os

There is also a text-based boot manager called systemd-boot 🔗 wiki.gentoo.org. As you can guess this is for systemd based Linux distributions. There are some distros that are using systemd-boot, like Pop OS.

systemd-boot in Pop OS | Image kofler.info/pop_os

Access or edit GRUB

Usually the GRUB screen you see is its menu interface. If you have more than one operating system installed, it will allow you to choose one of them to start. You can also choose to load a different kernel if your Linux distribution has more than one kernel installed.

Depending on the configuration of your Linux distribution, you may have some other options on your GRUB menu.

You can edit menu items by pressing the e key in the GRUB menu interface. This way you can modify the parameters of the kernel before it loads. For example, in some cases, disabling the graphics driver provided by the kernel can help you solve the problem of your Linux system getting stuck on boot 🔗 itsfoss.com .

You can also press c from the GRUB menu interface to enter the GRUB command line menu.

GRUB configuration file

Any changes you make to GRUB in the menu interface are temporary. If you want to make some permanent changes to GRUB, such as changing the default timeout, you can modify the GRUB configuration file after the Linux system boots.

The default GRUB configuration file is /etc/default/grub. There is also a /etc/default/grub.d directory, which also stores some configuration. You can edit the /etc/default/grub file directly, but I recommend making additional modifications by adding configuration files ( .cfg files) in this directory.

Default GRUB configuration file

You must update GRUB for these changes to take effect 🔗 itsfoss.com .

Use the GRUB customizer to customize GRUB

If you are not used to editing files with a text editor in the terminal 🔗 itsfoss.com , you can use a graphical tool called the GRUB customizer 🔗 itsfoss.com .

It allows you to change the startup sequence, default timeouts, and more. You can also use it to set the GRUB background as a custom wallpaper.

The GRUB customizer can be installed from the Universe repository in Ubuntu 20.04 and via PPA in Ubuntu 18.04 🔗 itsfoss.com . It is available in Arch Linux based distributions via AUR 🔗 itsfoss.com.

Summarize

So far, this article has covered almost all the simple stuff related to GRUB. As for EFI, bootloading, and GRUB itself, they are all detailed and complex topics and are therefore outside the scope of this article. This article aims to give you a general overview of the GRUB bootloader.

Maybe I'll write a detailed guide on GRUB in the future, explaining some of its low-level details. Currently, if you want to learn more about GRUB, you can access the GRUB documentation using the info grub command in your Linux terminal.

You can access the GRUB manual in the terminal

I hope you now have a little understanding of what GRUB is. Here's a GIF for your enjoyment.

What is GRUB? UEFI can't hurt me anymore :)

Maybe I didn't answer all your questions about GRUB, but feel free to let me know in the comments. I may update this post with your questions or suggestions.

via: https://itsfoss.com/what-is-grub/

Author: Abhishek Prakash Topic: lujun9972 Translator: lkxed Proofreading: wxy

This article was originally compiled by LCTT, and was launched with honor by Linux China

Welcome to reprint in accordance with the CC-BY-SA agreement,

If you want to reprint, please leave a message under the article " Reprint: Official Account Name ",

We will add a whitelist for you to authorize " modification when reprinting articles ".

終端大師 Terminal Master

Related Posts