Interview Prep/Linux/Boot Process & Kernel

What does GRUB2 do and where is its configuration?

BeginnerConceptBoot Process & Kernel
Answer

In one line: GRUB2 is the bootloader — the program that shows the boot menu and loads the Linux kernel into memory.

What GRUB does:

  • Shows a menu, so you can pick which kernel to boot (useful when a new kernel breaks and you need the old one).
  • Loads the kernel and initramfs into memory.
  • Passes kernel parameters (settings) to the kernel, such as quiet or console=ttyS0.

Where its configuration lives:

  • Edit this file: /etc/default/grub — simple settings like the timeout and kernel parameters.
  • Don't edit this file by hand: /boot/grub2/grub.cfg (or /boot/grub/grub.cfg). It is generated automatically, and your changes would be overwritten.

Example — add a kernel parameter and apply it:

sudo vi /etc/default/grub
# change:  GRUB_CMDLINE_LINUX="... quiet"
sudo update-grub                                  # Ubuntu/Debian
sudo grub2-mkconfig -o /boot/grub2/grub.cfg       # RHEL/CentOS/Rocky

Remember: edit /etc/default/grub, then regenerate the config. Changes apply on the next reboot.

All Linux questions Roadmap: Linux

More on Boot Process & Kernel