About grub in linux

What exactly is GRUB?

Can anyone explain me with fairly simple words and not too technical concepts what exactly is GRUB, what is its primary usage and how to use it efficiently for a dual boot Windows/Ubuntu installation? I have already read a couple of resources but I am still confused.

Welcome to askubuntu. I feel your question is too broad. I suggest you start here — en.wikipedia.org/wiki/Linux_startup_process . At the final step Ubuntu uses upstart , which is discussed here — en.wikipedia.org/wiki/Upstart . After reading those overviews, if you have a more specific question about UBUNTU then come back here. If it is about booting in general, the kernel, or general linux you will be referred to alternate sites such as stackexchange.

3 Answers 3

Basically, GRUB bootloader is the software that loads the Linux kernel. (It has other uses as well). It is the first software that starts at a system boot.

When the computer starts, BIOS first run a Power-on self-test (POST) to check hardware like memory, disk drives and that it works properly.

Then BIOS checks the Master Boot Record (MBR), which is a 512 byte section located first on the Hard Drive. It looks for a bootloader (like GRUB). The hard drive’s partition tables are also located here.

enter image description here

Then you’ll be prompted by the GRUB menu which can contain a list of the operating systems installed (in the case of dual boot), or perhaps the different kernels installed in a Linux distro.

When you choose which distro or kernel you want to use, GRUB loads the selected kernel. The kernel starts init (or systemd ), which is the first process to start in Linux. init then starts other processes like network services and other that you might have configured to start at boot time.

Читайте также:  Linux посмотреть raid массив

The boot process contains alot of defined expressions and terms, way to much to add in a simple answer like this. Google is your friend!

Remember that this is a very basic explanation of the boot process and GRUB’s role in it.

This youtube video provides a pretty nice introduction to the linux boot process, including basic information on the GRUB Bootloader:

Источник

Linux Jargon Buster: What is Grub in Linux? What is it Used for?

If you ever used a desktop Linux system, you must have seen this screen. This is called the GRUB screen. Learn what is GRUB in Linux and what is it used for?

Grub Screen Linux

If you ever used a desktop Linux system, you must have seen this screen. This is called the GRUB screen. Yes, it is written in all capital letters. In this chapter of the Linux Jargon Buster series, I’ll tell you what Grub is and what is it used for. I’ll also briefly touch upon the configuration and customization part.

What is GRUB?

GRUB is a complete program for loading and managing the boot process. It is the most common bootloader for Linux distributions. A bootloader is the first software that runs when a computer starts. It loads the kernel of the operating system and then the kernel initializes the rest of the operating system: shell, display manager, desktop environment, etc.

Boot loader vs boot manager

Disk Partition Gparted

I didn’t want to confuse you at this stage but this topic needs to be introduced before going on. There is a blurry line between a bootloader and a boot manager. You already know that the bootloader starts first and then loads the kernel into memory and executes it. A boot manager program allows you to choose between operating systems, if there is more than one on your system. A boot manager doesn’t load the OS directly, With Linux kernel version 3.3, the Linux kernel includes a built-in EFI bootloader. In fact, any operating system that is capable of working the EFI system includes an EFI bootloader. In EFI capable systems, the firmware reads the EFI system partition (ESP) to locate the EFI files for boot information. GRUB is both a bootloader and a boot manager. I’ll come back to GRUB in a moment. First, let’s see other GRUB-like programs.

Читайте также:  Linux open oracle port

Trivia: GRUB is acronym for GRand Unified Bootloader.

What are those lines in Grub screen mean?

Boot into recovery mode

You’ll see a few lines on the Grub screen. These lines will be different for different setups, different distributions. Usually, the first line is your Linux distribution. If you see something like Advanced option, you can enter into it and find some lines starting with linux-generic-x-y-z etc. When your Linux distribution updates the kernel version, it keeps at least one older version. You can choose to boot into the older Linux kernels in case your system encounters any issue with the newly updated Linux kernel. You may also see a recovery option in Ubuntu based distribution. At the last, you may see an entry like System setup or UEFI Settings to access the BIOS settings of your system.

What are some other boot managing programs similar to GRUB?

GRUB is the most popular boot manager for Linux. But it is not the only one. There is the highly customizable rEFInd boot manager that some Linux users love. Refind Boot ManagerThere is also systemd-boot text-based boot manager. You can guess that this is exclusively for systemd-based Linux distributions. Some distributions such as Pop OS, use the systemd-boot. systemd-Boot in Pop OS

Accessing or editing GRUB

Editing grub to fix frozen boot issue with Ubuntu Linux

The usual GRUB screen you see is its menu interface. It allows you to choose which operating systems to boot, if there is more than one on your machine. You can also choose to load a different kernel if your Linux distribution has more than one installed. Depending upon the configuration set by the Linux distribution, you may have some other entries on the GRUB menu. You can edit a GRUB menu entry by pressing the “e” key. This way, you can change the kernel parameters before loading it. For example, in some cases, disabling the graphics driver from the kernel helps you with Linux system stuck at boot. You can also enter the command line menu of GRUB using the “c” key at the GRUB menu interface.

Читайте также:  Ark manager для linux

GRUB configuration file

Default Grub Config File

Any changes you make to GRUB from the menu interface is temporary. If you want to make some permanent changes to GRUB, such as changing the default timeout, you can change the configuration file after you boot into your Linux system. The default GRUB configuration file is located at /etc/default/grub. There is also a /etc/default/grub.d directory. You may edit the /etc/default/grub file directly, however it is advised to make additional changes by adding config files (.cfg files) in this directory. You must update GRUB for the changes to take into effect. In fact, whenever you install an additional Linux on your system, it will try to overwrite the existing GRUB config with its own.

GRUB customizer for easily customizing GRUB

Make Windows default option in Grub in dual boot mode

If you think editing a file with a text editor in the terminal is not something you feel comfortable with, you can use a graphical tool called GRUB Customizer. It allows you to change the boot order, default timeout etc. You can also use it to change the background of GRUB with a custom wallpaper. GRUB Customizer can be installed in Ubuntu 20.04 from Universe repository and via PPA in Ubuntu 18.04. It is available via AUR in Arch Linux based distributions.

Conclusion

Grub Manual Linux Terminal

I have touched everything on the surface. EFI, boot loading and GRUB itself is detailed and complicated topic and not in the scope of this article. This article intended to give you a high-level overview of the GRUB boot program. Perhaps I’ll write a detailed guide on GRUB explaining the low-level details. For now, if you want to learn more about GRUB, you can access the GRUB documentation in your Linux terminal using the info grub command. I hope you have a tad bit better understanding of what GRUB is now. Here’s a GIF to humor you. I may not have answered all questions you have about GRUB. Please feel free to let me know in the comment section. I may update the article with your questions or suggestions.

Источник

Оцените статью
Adblock
detector