DEV Community

Aryan Vaishnani
Aryan Vaishnani

Posted on

Basic Boot Process

Basic Boot Process in Linux

The boot process is the sequence of steps that happens when a computer starts until the Linux operating system becomes ready for use.

1. Power On

  • User presses the power button.
  • CPU starts executing firmware instructions stored on motherboard.

2. BIOS or UEFI

BIOS

Basic Input Output System

UEFI

Unified Extensible Firmware Interface

These firmware systems:

  1. Check hardware components
  2. Detect CPU, RAM, disks, keyboard
  3. Perform POST (Power-On Self Test)
  4. Find bootable device

POST (Power-On Self Test)

Checks:

  1. RAM
  2. CPU
  3. Storage devices
  4. Keyboard and peripherals

If hardware fails, system may show error beeps or messages.

3. Bootloader Stage

The bootloader loads the Linux kernel into memory.

Most Linux systems use:

GNU GRUB

Responsibilities of GRUB

  1. Shows boot menu
  2. Select operating system
  3. Loads Linux kernel
  4. Loads initramfs/initrd

GRUB Configuration Location

Common files:

/boot/grub/

/boot/grub2/

Main config:

grub.cfg

4. Linux Kernel Loading

After GRUB:

  1. Linux kernel loads into RAM
  2. Kernel initializes hardware
  3. Drivers are loaded
  4. Root filesystem is mounted

Kernel file example:

vmlinuz

initramfs / initrd

Temporary filesystem loaded during boot.

Purpose:

  1. Load required drivers
  2. Prepare root filesystem
  3. Help kernel access storage devices

5. Init/Systemd Process

After kernel initialization, the first userspace process starts.

Traditionally:

init

Modern Linux systems mainly use:

systemd

Process ID:

PID 1

Responsibilities of systemd/init

  1. Start system services
  2. Mount filesystems
  3. Configure networking
  4. Start login services
  5. Manage system targets/runlevels

5. Starting Services

System services start in background.

Examples:

  1. SSH server
  2. Network manager
  3. Database services
  4. Docker daemon
  5. Web servers

Example:

sshd
docker
nginx

6. Login Screen or Shell

Finally system provides:

  1. GUI login screen
  2. Terminal login shell

User enters:

  • Username
  • Password

System becomes ready for use.

Linux Boot Flow Diagram

Power On

BIOS / UEFI

POST Check

Bootloader (GRUB)

Linux Kernel

initramfs/initrd

systemd/init

Services Start

Login Screen / Shell

Important Boot Files

File/Component Purpose
BIOS/UEFI Hardware initialization
GRUB Bootloader
vmlinuz Linux kernel
initramfs Temporary boot filesystem
systemd Service manager
/boot Boot files directory

Common Commands Related to Boot

Check Current Kernel

uname -r

View Boot Logs

journalctl -b

Check Running Services

systemctl list-units --type=service

Check Default Target

systemctl get-default

Common Boot Problems

  1. Corrupted GRUB
  2. Missing kernel files
  3. Filesystem corruption
  4. Failed services
  5. Wrong fstab configuration
  6. Kernel panic

Kernel Panic

A critical kernel error where the system cannot continue booting.

Causes:

  1. Driver failures
  2. Hardware problems
  3. Corrupted kernel
  4. Memory issues

Top comments (0)