Fundamentals 11 min read

Understanding the Linux Boot Process: From Power-On to User Login

This article walks through the three-stage Linux boot sequence—power‑on, BIOS/UEFI initialization, and kernel startup—detailing the role of MBR, GRUB2, init processes, runlevels, fstab configuration, and user login mechanisms.

Open Source Linux
Open Source Linux
Open Source Linux
Understanding the Linux Boot Process: From Power-On to User Login

Linux Boot Process Overview

The Linux startup procedure can be divided into three main stages: power‑on, BIOS/UEFI initialization, and the Linux kernel boot.

Step 1: Power On

In x86 systems, the top 64 KB of the first megabyte (0xF0000‑0xFFFFF) is mapped to ROM. When the computer is powered on, the CPU resets CS to 0xFFFF and IP to 0x0000, causing the first instruction to fetch from 0xFFFF0, which resides in ROM. A JMP instruction then transfers control to BIOS initialization code.

Step 2: BIOS/UEFI Startup

Firmware initialization includes hardware detection, self‑test, and loading of firmware drivers. The firmware selects a boot device based on a predefined order, loads the device’s UEFI drivers, and then loads a UEFI application such as a bootloader (e.g., GRUB, rEFInd) from the EFI system partition.

Step 3: Linux Boot

Bootloader (GRUB2) Introduction

GNU GRUB (GRand Unified Bootloader) is a multi‑OS boot manager that lets users choose among several operating systems or kernel versions at startup. Configuration is generated with grub2-mkconfig -o /boot/grub2/grub.cfg and installed via grub2-install /dev/sda .

GRUB2 Loading

GRUB2 first loads boot.img into memory at 0x7c00; boot.img loads core.img . From a disk boot, diskboot.img loads core.img , which then decompresses lzma_decompress.img , loads kernel.img , and finally loads module images. Because the 1 MB real‑mode address space is insufficient, GRUB switches to protected mode before full decompression.

Process 0 and Process 1

The kernel creates the first process, the “0‑th process” (init_task), which is not created via fork or kernel_thread . Subsequent initialization steps include trap_init() , mm_init() , sched_init() , vfs_caches_init() , and start_kernel() → rest_init() . rest_init spawns the “1‑st process” using kernel_thread(kernel_init, NULL, CLONE_FS) , a pivotal step for the OS.

Ramdisk and Init

Because drivers are needed to access storage devices, Linux first uses a memory‑based filesystem (ramdisk) as the root filesystem. The ramdisk runs /init , which loads the appropriate storage drivers, mounts the real root filesystem, and then executes the real /sbin/init (or alternatives).

Init Variants

Different Linux versions use different init systems: SysV (CentOS 5 and earlier, configured via /etc/inittab ), Upstart (CentOS 6, using /etc/init/*.conf ), and systemd (CentOS 7+, configured in /usr/lib/systemd/system and /etc/systemd/system ).

Runlevels

/etc/fstab

After hardware is detected, Linux mounts devices according to /etc/fstab . Each line contains six fields: device (or UUID/label), mount point, filesystem type, mount options, dump flag, and fsck order. This file enables automatic mounting on each boot.

User Login

Linux supports three login methods: console (command‑line), SSH, and graphical login. The console device ( /dev/console ) receives kernel messages, while virtual terminals ( /dev/ttyN ) and pseudo‑terminals ( /dev/pts/N ) handle user sessions and remote connections.

User Switching

Linux provides six virtual terminals (tty1‑tty6). Users typically log in on tty1; switching between terminals is done with Ctrl+Alt+F1 through Ctrl+Alt+F6 . In VirtualBox, Ctrl+Alt+F1 opens the graphical console, while Ctrl+Alt+F2‑F6 access text consoles.

Boot Process Mind Map

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

linuxOperating SystemBoot ProcessinitGRUB
Open Source Linux
Written by

Open Source Linux

Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.