Based on the Linux Master 1 exam syllabusReport an error
/, /boot, swap, /home, and /var./etc/default/grub and regenerate with grub2-mkconfig. Editing grub.cfg directly is the wrong answer.You should be able to explain, step by step, what happens from the moment you press the power button until the login prompt appears. The starting point is disk design.
/var fills up, / (root) is fine.| Partition | Mount point | Role |
|---|---|---|
| Root | / | The reference point for the entire system, required |
| Boot | /boot | Kernel images and bootloader files (separating it is recommended) |
| Swap | swap | Virtual memory, a supplement when RAM runs short |
| Home | /home | User data, convenient to preserve on reinstall |
| Variable | /var | Frequently changing data such as logs, caches, and mail |
There are two traditional reasons to split /boot into a separate partition. First, older BIOSes could only read the kernel within a certain range at the front of the disk (1024 cylinders), so the boot files had to be placed near the front of the disk. Second, even if the root filesystem is complicated by LVM, encryption, RAID, and so on, keeping /boot simple ensures the bootloader can reliably access it.
Partition information is recorded somewhere on the disk as a "partition table." There are two kinds, and it is a comparison topic on the Level 1 exam.
| Item | MBR | GPT |
|---|---|---|
| Max disk size | 2TB | 9.4ZB |
| Number of partitions | 4 primary or 3 primary + 1 extended | 128 by default |
| Firmware | BIOS | UEFI (BIOS-compatible possible) |
| Backup | Single | Stored twice, front and back |
# Check disk and partition information
lsblk # Block devices in a tree
fdisk -l # Details of MBR/GPT partition tables
parted -l # A tool that handles GPT better
blkid # Partition UUIDs and filesystem types
# Try it yourself: view the current disk structure as a tree
lsblk -f # Also shows filesystem information⚠️ Pitfall: The phrase "4 primary partitions + an extended partition" for MBR is wrong. The extended partition also occupies one of the 4 slots, so the accurate statement is "up to 4 primary partitions, or 3 primary partitions + 1 extended partition." You work around the limit of 4 by creating several logical partitions inside the extended partition.
From the moment you press the power button until the login screen is like a huge relay race. Each stage wakes the next one and passes the baton.
[Power ON]
↓
1. Firmware (BIOS or UEFI) - hardware check (POST), select boot device
↓
2. Bootloader (GRUB2) - loads the kernel into memory
↓
3. Kernel (vmlinuz) - initializes hardware, mounts root via initramfs
↓
4. init/systemd (PID 1) - starts services, login prompt
↓
[Login screen]
/boot/efi, FAT-formatted)| Item | BIOS | UEFI |
|---|---|---|
| Bootloader location | MBR (first sector) | ESP (a file on the EFI partition) |
| Partition scheme | Mostly MBR | Mostly GPT |
| Disk limit | 2TB | Over 2TB possible |
| Security | None | Secure Boot |
UEFI Secure Boot requires digital signatures on the bootloader and kernel to stop rootkits from interfering in the boot process. For this, Linux distributions load GRUB through a small bootloader called "shim" that carries a Microsoft signature. A practical pitfall is that loading an unsigned kernel module with Secure Boot enabled requires extra configuration (MOK enrollment).
# Configuration files the user edits
/etc/default/grub # Basic settings (timeout, kernel parameters, etc.)
/etc/grub.d/ # Scripts that generate menu entries
# The final auto-generated configuration file (do NOT edit directly!)
/boot/grub2/grub.cfg # Red Hat family
/boot/grub/grub.cfg # Debian family
# After changing settings, you must regenerate grub.cfg for them to apply
grub2-mkconfig -o /boot/grub2/grub.cfg # Red Hat family
update-grub # Debian family (wrapper for grub-mkconfig)/boot/grub2/grub.cfg directly. This file is auto-generated from /etc/default/grub and /etc/grub.d/, so it gets overwritten the next time grub2-mkconfig runs./etc/default/grub, then regenerate with grub2-mkconfig.# Try it yourself: check the GRUB default settings
cat /etc/default/grub
# GRUB_TIMEOUT=5 Menu wait time (seconds)
# GRUB_DEFAULT=0 Default boot entry number
# GRUB_CMDLINE_LINUX="..." Boot parameters passed to the kernel⚠️ Pitfall: The exam asks for
grub2-mkconfig -o /boot/grub2/grub.cfgas "the command to apply changes after modifying GRUB2 settings." A choice saying you edited/boot/grub2/grub.cfgdirectly with vi is the wrong procedure. The difference that Red Hat uses thegrub2-prefix while Debian usesgrub-(orupdate-grub) is also tested.
The name "GRand Unified Bootloader" parodies the physics term "Grand Unified Theory." It carries the ambition to unify the booting of every operating system with a single bootloader. In fact, GRUB can boot not only Linux but also Windows, BSD, and nearly every other OS through chain loading.
Once GRUB2 loads the kernel image (/boot/vmlinuz-*) into memory and hands over control, the kernel becomes the star.
/), it needs the driver for that disk, but if that driver is inside the root filesystem itself, you hit a "chicken-and-egg" problem.# Check the initramfs image
ls /boot/initramfs-* # Red Hat family
ls /boot/initrd.img-* # Debian family
# Regenerate initramfs (after adding drivers)
dracut -f # Red Hat family
update-initramfs -u # Debian familyThe "z" in vmlinuz stands for compression (zip), and "vm" means the kernel supports virtual memory. The kernel is stored compressed to save disk space and because the reduced read time from disk offsets the cost of decompression (handled quickly by the CPU). The uncompressed version is vmlinux (no z), mostly used for debugging.
/etc/rc.d/ in order. It was slow because execution was serial.| Runlevel | State |
|---|---|
| 0 | System shutdown (halt) |
| 1 | Single-user mode (recovery) |
| 3 | Multi-user + network (text) |
| 5 | Multi-user + GUI |
| 6 | Reboot |
| SysV runlevel | systemd target |
|---|---|
| 3 (text multi-user) | multi-user.target |
| 5 (GUI) | graphical.target |
| 0 (shutdown) | poweroff.target |
| 6 (reboot) | reboot.target |
| 1 (single-user) | rescue.target |
# Manage services with systemd
systemctl start httpd # Start a service
systemctl enable httpd # Register to start automatically at boot
systemctl status httpd # Check status
systemctl get-default # Check the current default target
systemctl set-default multi-user.target # Set the default target to text mode
# Boot time analysis (systemd only)
systemd-analyze # Total boot time
systemd-analyze blame # Ranking of start time by servicesystemd is not just an init but a huge collection of tools that integrates all of system management. It covers service management (systemctl), log management (journalctl), time management (timedatectl), networking (networkd), and more. Some criticize it as "against the Unix philosophy (small tools)," but nearly every major distribution has adopted systemd. For Level 1, the systemctl commands and the runlevel↔target correspondence are the key.
systemd was announced in 2010 by Lennart Poettering of Red Hat. In the early days of its adoption there was a fierce debate (the systemd controversy) over "violating the Unix philosophy" and "being too bloated," and Debian even held a vote over its init system. Nevertheless, the benefits of dependency-based parallel booting and a consistent management interface were large, and in the end RHEL, Ubuntu, Debian, and SUSE all standardized on systemd.
Next time, we'll cover the directory structure (FHS) inside the mounted filesystem, and the concrete file types in which the "everything is a file" philosophy shows up in Linux.
/boot/efi.grub2-mkconfig.Click a choice to reveal the answer and explanation.
Question 1
Which is the correct order of the Linux boot process?
Question 2
Which is a correct description of the MBR and GPT partitioning schemes?
Question 3
What is the correct procedure to change and apply GRUB2 settings?
Question 4
What is the best description of the role of initramfs (initrd) in the boot process?
Question 5
Which of the following correspondences between SysV init runlevels and systemd targets is NOT correct?
Question 6
Which is a correct description of BIOS and UEFI firmware?