Introduction
This lesson answers a very practical question:
What happens from pressing the power button to getting a working Linux system?
For LPIC-1, you should understand the boot path and know where to look when boot fails.
Keep this simple picture in your head:
firmware -> bootloader -> kernel -> initramfs -> real root filesystem -> PID 1 -> login
If you know that order, you can usually tell where a problem belongs.
What you should be able to do after this lesson:
- Explain the Linux boot sequence in simple words.
- Check whether the system used BIOS or UEFI.
- Read the current kernel command line.
- Make a temporary boot change in GRUB.
- Recognize what initramfs does.
- Check boot messages and common failure clues.
Before you start:
sudomeans "run as administrator".<kernel-param>,<entry>,<device>are placeholders. Replace them with real values.- Different distributions store GRUB files in different paths. Focus on the idea first.
Big Picture: The Boot Sequence
When Linux boots, the system usually moves through these steps:
- Firmware starts first. This is BIOS or UEFI.
- Bootloader starts next. Most often this is GRUB 2.
- Kernel is loaded. The kernel begins hardware setup.
- initramfs helps early boot. It gives the kernel a temporary working environment in RAM.
- The real root filesystem is mounted.
- PID 1 starts.
This is usually
systemd, but it could also be another init system. - Services start, then you get a login prompt or desktop.
That is the story the exam wants you to understand.
Step 1: Firmware (BIOS or UEFI)
Firmware decides where boot starts.
Quick check
test -d /sys/firmware/efi && echo UEFI || echo BIOS
What is the difference?
BIOS
- older style firmware
- usually boots from the MBR area of a disk
UEFI
- modern firmware
- uses boot entries stored in NVRAM
- starts EFI programs from the EFI System Partition (ESP)
Optional UEFI check
If efibootmgr is installed:
sudo efibootmgr -v | head
This shows saved UEFI boot entries.
Step 2: Bootloader (Usually GRUB 2)
The bootloader's job is simple:
load a kernel, load an initramfs, and pass kernel parameters
Read the kernel command line used for this boot
cat /proc/cmdline
Example output:
BOOT_IMAGE=/boot/vmlinuz-6.1.0 root=UUID=xxxx ro quiet
Important parameters to recognize
root=...= where the root filesystem isro= mount root read-only firstrw= mount root read-writequiet= show fewer messages during boot
Useful troubleshooting parameters
systemd.unit=rescue.target= boot into rescue mode on systemd systemsnomodeset= often used for display problemssingleor1= old-style single-user boot idea you may still see in exam material
Temporary GRUB Edit: Safe and Important
For the exam, this is one of the most useful boot skills.
Typical flow
- Open the GRUB menu.
- Select an entry.
- Press
eto edit it. - Find the line that starts with
linuxor sometimeslinuxefi. - Add a temporary
<kernel-param>at the end of that line. - Boot with
Ctrl+xorF10.
Why this matters:
- it helps you test a fix
- it does not permanently change files on disk
GRUB Command Line: Basic Commands to Recognize
Sometimes GRUB itself becomes part of the troubleshooting process.
From the GRUB menu, you can press c to open the GRUB command line.
Commands to know:
ls
ls (<device>)/
set root=(<device>)
linux /vmlinuz root=...
initrd /initrd.img
boot
In plain words:
lshelps you discover disks and filesset root=...tells GRUB where to looklinux ...loads the kernelinitrd ...loads the initramfsbootstarts the boot process
Persistent GRUB Changes
Temporary changes are safer for testing. Persistent changes are for "I know this is the setting I want".
The usual place is:
/etc/default/grub
Typical variables:
GRUB_CMDLINE_LINUX=...GRUB_CMDLINE_LINUX_DEFAULT=...
Then regenerate the GRUB configuration. Common commands:
sudo update-grub
sudo grub-mkconfig -o <grub.cfg>
sudo grub2-mkconfig -o <grub.cfg>
Different distributions use different commands. The key exam idea is:
edit GRUB defaults -> rebuild GRUB config
Step 3: Kernel and initramfs
The kernel starts hardware initialization. But very early in boot, it may not yet know how to reach the real root filesystem.
That is why initramfs exists.
In simple words
initramfs is a temporary mini-filesystem in RAM.
It helps Linux do early jobs such as:
- load storage drivers
- find the root filesystem
- prepare RAID, LVM, or encrypted disks
Quick check
ls -1 /boot | head -n 12
uname -r
Example output:
vmlinuz-6.1.0
initrd.img-6.1.0
6.1.0
What this tells you:
- which kernel is installed
- which initramfs image matches it
- which kernel is currently running
Step 4: PID 1 and the Init System
After the kernel switches to the real root filesystem, it starts PID 1. PID 1 controls the rest of the startup process.
Quick check
ps -p 1 -o comm=
Possible results:
systemd= the modern default on most distributionsinit= often a classic init name; on older systems this may mean SysVinit or an Upstart-based setup
For this lesson, the important point is simple:
the kernel gets the system started, then PID 1 takes over
The next lesson goes deeper into runlevels, targets, shutdown, and reboot.
Boot Logs: Where to Look First
When boot goes wrong, logs are your map.
1) Kernel messages
dmesg | tail -n 20
journalctl -k -b --no-pager | tail -n 20
Use this when you want to see:
- hardware detection
- driver errors
- storage problems
2) Messages from the current boot
journalctl -b --no-pager | tail -n 20
Use this when you want the whole story of the current boot.
3) Only errors from this boot
journalctl -b -p err..alert --no-pager | head
4) Previous boot
journalctl --list-boots | head
journalctl -b -1 --no-pager | tail -n 20
This is very useful when the system booted badly before, but is working now.
Common Boot Failure Clues
You do not need to memorize every error message. You need to connect the message to the correct boot stage.
Wrong root filesystem
Message style:
ALERT! /dev/sda3 does not exist...
Common meaning:
- wrong
root=parameter - wrong disk name or UUID
- needed storage driver missing in initramfs
Kernel boots, but cannot reach the real system
Common meaning:
- broken or missing initramfs
- storage stack not ready
- RAID/LVM/encryption support missing early in boot
Black screen or video issue
Common meaning:
- graphics mode problem
- temporary test parameter:
nomodeset
Quick Recovery Mindset
If the system does not boot cleanly, think in this order:
- Did firmware start the correct disk?
- Did GRUB load the kernel?
- Did the kernel get the right
root=value? - Did initramfs have what it needed?
- What do
dmesgandjournalctlsay?
That order is often more important than remembering ten extra commands.
Practice Step by Step
1) Check what kernel parameters are active right now
- Run:
cat /proc/cmdline - Find:
root=,roorrw,quiet - Ask: does the active boot match what I expected?
2) Simulate a safe troubleshooting change in GRUB
- Open the GRUB menu.
- Press
eon an entry. - Add a temporary parameter such as
nomodesetorsystemd.unit=rescue.target. - Boot it once with
Ctrl+xorF10. - After a reboot, the change should be gone because it was temporary.
3) The system booted, but something is broken right after login
- Check current boot messages:
journalctl -b -p err..alert --no-pager | head - Check kernel messages:
journalctl -k -b --no-pager | tail -n 50 - If the problem looks like hardware, compare with lesson 101.1 tools such as:
lspci -nnk,lsusb -t,lsblk
Cheat Sheet
test -d /sys/firmware/efi && echo UEFI || echo BIOS= firmware mode checkefibootmgr -v= show UEFI boot entries/proc/cmdline= kernel command line used for this boot- GRUB temporary edit =
e, add parameter, boot withCtrl+xorF10 - GRUB command line =
c, then usels,set root=...,linux ...,initrd ...,boot /etc/default/grub= common place for persistent GRUB defaultsupdate-grub/grub-mkconfig/grub2-mkconfig= rebuild GRUB config/boot= common location for kernel and initramfs filesuname -r= current running kernel versionps -p 1 -o comm== identify PID 1dmesg= kernel messagesjournalctl -b= logs from the current bootjournalctl -k -b= kernel messages from the current bootjournalctl -b -1= previous boot logs
Test Your Knowledge
Complete the quiz to assess your understanding of this course's concepts.
