Sagar.BlogArticle
All posts
All posts
Linux

Linux Boot Process — From Power-On to Login

Understand each stage of the Linux boot process: BIOS/UEFI, GRUB bootloader, kernel initialization, systemd, and login.

March 28, 20255 min read
linuxsysadminbootgrubsystemd

Boot Stages Overview

StageWhat Happens
BIOS/UEFIHardware self-test (POST), finds boot device
GRUBLoads the kernel and initrd into RAM
KernelInitializes hardware, mounts root filesystem
systemdStarts services, reaches boot target
LoginPresents TTY or display manager

systemd Targets (Runlevels)

TargetOld RunlevelDescription
poweroff.target0Shutdown
rescue.target1Single-user recovery
multi-user.target3Multi-user, no GUI
graphical.target5Multi-user with GUI
reboot.target6Reboot
# Check current default target
systemctl get-default

# Change default target
sudo systemctl set-default multi-user.target   # CLI only
sudo systemctl set-default graphical.target    # With GUI

GRUB — Boot Loader

# Update GRUB config (Debian/Ubuntu)
sudo update-grub

# Update GRUB config (Fedora/RHEL)
sudo grub2-mkconfig -o /boot/grub2/grub.cfg

# Edit GRUB settings (timeout, resolution, etc.)
sudo vim /etc/default/grub
# Change: GRUB_TIMEOUT=5
sudo update-grub

If a system won't boot, you can access rescue.target from the GRUB menu by appending systemd.unit=rescue.target to the kernel line.

Quick Check

What is the first process started by the Linux kernel after boot?

Exercise

Check your system's default boot target and view the current boot's journal messages.