Lesson 2 of 29 ↓
- 1.Rhel 9 Administration Guide
- 2.Ubuntu Boot Process Guide
- 3.Linux Basic Commands Guide
- 4.Comprehensive Unix Shells Guide
- 5.Mastering Vim Deep & Practical Guide
- 6.Magic Numbers in Linux Deep Systems Guide
- 7.Wildcards & Globbing in Linux Deep Cli Guide
- 8.Linux Users & Groups Deep Administration Guide
- 9.Journaling in Linux Filesystems Deep Systems Guide
- 10.Getopt & Getoptlong Deep System-level Option Parsing Guide
- 11.Su Command in Linux Complete Guide with Environment Variables
- 12.Linux File Permissions and Ownership Complete Practical Guide
- 13.Ubuntu Package Management Apt Complete Guide
- 14.Bash Scripting Basics
- 15.Linux File System Essentials
- 16.Process and Thread Management
- 17.Session 10 : Introduction to Networking & the Application Layer
- 18.Linux Networking Cli & Introduction to Yocto for Machine Routing
- 19.Comprehensive Guide to Ssh (secure Shell)
- 20.Logical Volume Management (lvm) Guide
- 21.C Build Process & Libraries Guide
- 22.Archiving and Compression in Linux
- 23.Linux Package Managers: a Detailed Guide
- 24.Misra-c Guidelines Detailed Cheat Sheet
- 25.Mqtt Server Setup (pc as Server)
- 26.Detailed Explanation of Tty and Pts in Linux
- 27.Vim Cheat Sheet
- 28.Difference Between apt and apt-get
- 29.Difference Between apt Upgrade and apt Full-upgrade
4 min read
Ubuntu Boot Process Guide
Welcome to the Ubuntu Boot Process Guide! This document provides a comprehensive overview of the Ubuntu booting process, including detailed explanations of each step, diagram descriptions, practical exercises, and insights into virtualization, hypervisors, the init process, and systemd.
Introduction
Understanding the boot process is fundamental to mastering Linux systems like Ubuntu. This guide explores each stage of the boot sequence, provides visual descriptions, and offers practical exercises to reinforce knowledge. It also covers virtualization concepts, hypervisors, the init process, and systemd, which are essential for modern Linux environments.
Boot Process Overview
The boot process is the sequence of steps that occur when a computer powers on and loads the operating system.
High-Level Boot Sequence:
-
Power On
-
BIOS/UEFI Initialization
-
Bootloader Execution
-
Kernel Loading
-
System Initialization
-
User Space Initialization
Detailed Steps of the Boot Process
A. Bios/uefi Initialization
BIOS vs UEFI
-
BIOS (Basic Input/Output System): Legacy firmware used for hardware initialization and POST.
-
UEFI (Unified Extensible Firmware Interface): Modern firmware with faster boot, Secure Boot, and GPT support.
Key Functions
-
Power-On Self-Test (POST)
-
Hardware initialization
-
Boot device selection
Additional Details
-
Acts as a bridge between hardware and OS
-
Allows configuration of boot order, security, and hardware settings
Diagram Description
[Power On]
|
[BIOS/UEFI Initialization]
|
[Locate Boot Device]B. Bootloader Execution
Once the boot device is selected, BIOS/UEFI loads the bootloader.
Common Bootloaders
-
GRUB (Linux)
-
NTLDR (legacy Windows)
-
BOOTMGR (modern Windows)
MBR Structure
-
Bootstrap Code (446 bytes)
-
Partition Table (64 bytes)
-
Boot Signature (0x55AA)
Boot Process
-
Load bootloader into RAM
-
Display boot menu
-
Load selected kernel
Additional Details
-
GRUB supports multi-boot and kernel parameters
-
UEFI bootloaders reside in ESP as
.efifiles
Diagram Description
[MBR/ESP] → [GRUB] → [Kernel]C. Kernel Loading
The bootloader loads the Linux kernel into memory.
Steps
-
Load kernel image (vmlinuz)
-
Pass parameters to kernel
-
Initialize memory, drivers, and mount root filesystem
Additional Details
-
initrd/initramfs: Temporary filesystem for early boot tasks
-
Kernel Parameters: Control boot behavior (quiet, splash, nomodeset)
Diagram Description
[Bootloader] → [Kernel + initramfs]D. System Initialization
I. the Init Process
-
First kernel process (PID = 1)
-
Initializes userspace and manages services
-
Historically used SysVinit
SysVinit Characteristics
-
Runlevels define system states
-
Startup scripts in
/etc/init.d/ -
Sequential startup
Limitations
-
Slow boot
-
Poor dependency handling
Ii. Introduction to Systemd
systemd Overview
-
Modern init and service manager
-
Parallel startup
-
Dependency-based service handling
Key Features
-
Unit files
-
Parallel initialization
-
Centralized logging (journald)
-
State tracking and service restarts
Components
-
systemctl -
journald -
networkd,resolved,timedated
Iii. Differences Between Systemd and Traditional Init Systems
| Feature | SysVinit | systemd |
|---|---|---|
| Service Management | Shell scripts | Declarative unit files |
| Startup | Sequential | Parallel |
| Dependencies | Manual | Automatic |
| Logging | External tools | journald |
| Monitoring | Limited | Advanced |
| Resource Control | Basic | cgroups |
| Boot Performance | Slower | Faster |
Advantages of systemd
-
Faster boot
-
Unified configuration
-
Better monitoring
Criticisms
-
Increased complexity
-
Monolithic design
Visual Diagrams
Boot Process Flowchart
Power On
↓
BIOS/UEFI
↓
Bootloader (GRUB)
↓
Kernel
↓
systemd
↓
Login / DesktopComponent Interaction Diagram
[BIOS/UEFI]
|
[Bootloader]
|
[Kernel + initramfs]
|
[systemd]
|
[Services & UI]Practical Exercises in Ubuntu
Viewing Boot Messages
dmesg | less
dmesg | grep -i networkExploring Grub
cat /boot/grub/grub.cfgNote
Edit
/etc/default/gruband runsudo update-grub.
Modifying Grub Timeout
sudo nano /etc/default/grub
sudo update-grubInspecting Systemd
systemctl status
systemctl list-units --type=serviceUnderstanding the Kernel
uname -r
dpkg --list | grep linux-imageCustomizing Kernel Parameters
sudo nano /etc/default/grub
sudo update-grubSystemd Units and Targets
systemctl list-units --type=target
sudo systemctl set-default multi-user.targetViewing Init Pid
ps -p 1 -o pid,comm
systemctl show --property=MainPID
pstree -p | grep initVirtualization and Hypervisors
Understanding Virtualization
Virtualization enables multiple OS instances to run on one physical machine.
Benefits
-
Resource efficiency
-
Isolation
-
Flexibility
-
Cost savings
Types of Hypervisors
Type 1 (Bare-Metal)
- VMware ESXi, KVM, Hyper-V
Type 2 (Hosted)
- VirtualBox, VMware Workstation, QEMU
Hypervisors in Ubuntu
-
KVM
-
QEMU
-
VirtualBox
-
VMware Workstation Player
Practical Exercise: Kvm Setup
sudo apt update
sudo apt install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils virt-manager
sudo usermod -aG libvirt $(whoami)
sudo usermod -aG kvm $(whoami)Additional Resources
-
Ubuntu Documentation: https://help.ubuntu.com/
-
GRUB Manual: https://www.gnu.org/software/grub/manual/
-
systemd Documentation: https://www.freedesktop.org/wiki/Software/systemd/
-
DigitalOcean systemd Guide
Conclusion
Understanding the Ubuntu boot process provides deep insight into Linux internals and system administration. Mastery of boot stages, systemd, and virtualization enables better troubleshooting, performance tuning, and system customization.
Comments
Loading the discussion…