LPIC-2 Labs

Advanced Linux administration aligned with LPIC-2 (Exams 201 & 202). Kernel and boot troubleshooting, enterprise storage with LVM, and network services configuration.

These Labs Cover All Major Linux Certifications

LPI Linux Essentials CompTIA Linux+ (XK0-006) LPIC-1 (101 & 102) LPIC-2 (201 & 202) LPIC-3 (300 / 303 / 305 / 306)
RHCSA (EX200) RHCE (EX294) RHCA LFCS LFCE LFCA CKA CKAD CKS

LPIC-2 Labs - Module 5

Kernel modules & boot diagnostics, enterprise storage with LVM, and DNS server configuration — core LPIC-2 domains.

Lab 13: Kernel Modules & Boot Diagnostics
Advanced / Terminal + GUI
Scenario: Stabilize a Server After a Kernel Change
After a recent maintenance window, the server boots but a device driver is missing and the team reports intermittent failures. You must inspect the running kernel, review loaded modules, load and remove a kernel module safely, verify bootloader configuration, and confirm kernel boot parameters. These are common LPIC-2 troubleshooting tasks.

Learning Objectives:

LPIC-2 201 — Kernel + Boot
  • Kernel Version: Identify the running kernel and boot parameters
  • Module Inventory: Inspect loaded modules and dependencies
  • Module Management: Load/unload modules with modprobe
  • Bootloader: Review GRUB configuration and regenerate config

📋 Step-by-Step Instructions

  1. Step 1: Identify the Running Kernel and Module Inventory
    🎯 Goal: Confirm kernel version and get a quick module snapshot

    💻 Show kernel release:
    uname -r

    💻 Show a short module list (top 10):
    lsmod | head -10

    Tip: Use the Kernel Dashboard tab to see module counts and status in a clean UI.
    💡 Tip: LPIC-2 expects you to know lsmod (loaded modules) vs modinfo (module metadata).
  2. Step 2: Inspect Module Details
    🎯 Goal: Check module description, filename, and dependencies

    💻 Inspect ext4 module details:
    modinfo ext4

    💻 Inspect xfs module details:
    modinfo xfs
    💡 Tip: modinfo shows the module filename path, which is useful when verifying kernel updates.
  3. Step 3: Load a Kernel Module
    🎯 Goal: Load the "dummy" module and verify it is loaded

    💻 Load the module:
    sudo modprobe dummy

    💻 Verify it appears in lsmod:
    lsmod | grep dummy
    ⚠️ Warning: In production, loading the wrong module can disrupt devices. Always verify module name and purpose first.
  4. Step 4: Remove the Kernel Module Safely
    🎯 Goal: Unload the dummy module and verify it is gone

    💻 Remove the module:
    sudo modprobe -r dummy

    💻 Confirm it is not listed:
    lsmod | grep dummy
    💡 Tip: If a module is in use, removal fails. You must stop dependent services first.
  5. Step 5: Review and Regenerate GRUB Configuration
    🎯 Goal: Review /etc/default/grub and regenerate grub.cfg

    💻 View GRUB defaults:
    cat /etc/default/grub

    💻 Regenerate GRUB configuration:
    sudo grub-mkconfig -o /boot/grub/grub.cfg

    Hint: Use the GRUB Viewer tab to see an excerpt of the resulting config.
    💡 Tip: Different distros store GRUB differently (e.g., /boot/grub2/). The concept is the same: change defaults, regenerate config.
  6. Step 6: Confirm Boot Parameters and Recent Boot Messages
    🎯 Goal: Validate kernel command line and recent kernel messages

    💻 Show kernel cmdline:
    cat /proc/cmdline

    💻 Show recent kernel messages:
    dmesg | tail -15
    🎓 Checkpoint: You can now inspect modules and GRUB state and validate boot parameters — core LPIC-2 troubleshooting skills.

Linux Terminal

Terminal
Kernel Dashboard
GRUB Viewer
Activity Log
root@kernelhost:~#
Kernel Status
Kernel ReleaseUnknown
Loaded Modules (approx.)0
dummy ModuleNot loaded
GRUB Config GeneratedNo
Module Inventory (Key Modules)
ModuleSizeDescriptionStatus
/etc/default/grub
# GRUB default settings GRUB_TIMEOUT=5 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` GRUB_DEFAULT=0 GRUB_CMDLINE_LINUX_DEFAULT="quiet" GRUB_CMDLINE_LINUX=""
grub.cfg Excerpt
# grub.cfg not generated yet
Recent Activity
[--:--:--]Lab session started. Ready for commands.
Progress: 0/6 tasks completed
Score: 0/100
🎉 After Completing All Steps:

1. Click "Validate Configuration" to see what is complete and what remains.
2. Use Kernel Dashboard and GRUB Viewer to verify state visually.
Tip: Validation is strict — copy commands from the steps to avoid typos.
Lab 14: LVM Advanced Storage Management
Advanced / Terminal + GUI
Scenario: Provision and Expand Application Storage
A new disk has been attached to the server for application storage. You must initialize it as an LVM physical volume, create a volume group and logical volume, format it with ext4, mount it, configure persistent mounting, then extend the logical volume and resize the filesystem. LPIC-2 frequently tests LVM workflows.

Learning Objectives:

LPIC-2 201 — Storage
  • PV/VG/LV: Create and inspect LVM physical/volume/logical volumes
  • Filesystem: Format and mount logical volumes safely
  • Persistence: Configure /etc/fstab for boot-time mounting
  • Expansion: Extend LVs and resize ext4 filesystems

📋 Step-by-Step Instructions

  1. Step 1: Identify the New Disk
    🎯 Goal: Confirm /dev/sdc is present and empty

    💻 List block devices:
    lsblk

    💻 Inspect /dev/sdc:
    sudo fdisk -l /dev/sdc
    💡 Tip: Always confirm device names before running storage commands. Mistakes can destroy data.
  2. Step 2: Create a Physical Volume (PV)
    🎯 Goal: Initialize /dev/sdc as an LVM PV and verify

    💻 Create PV:
    sudo pvcreate /dev/sdc

    💻 List PVs:
    sudo pvs
    💡 Tip: PVs are the building blocks of LVM. You can add multiple PVs to a VG later for expansion.
  3. Step 3: Create a Volume Group (VG)
    🎯 Goal: Create vgdata using the PV and verify

    💻 Create VG:
    sudo vgcreate vgdata /dev/sdc

    💻 List VGs:
    sudo vgs
    💡 Tip: VG names should reflect purpose (data, app, backup). Consistent naming helps in incident response.
  4. Step 4: Create a Logical Volume (LV)
    🎯 Goal: Create a 5G LV named lvapp and verify

    💻 Create LV:
    sudo lvcreate -L 5G -n lvapp vgdata

    💻 List LVs:
    sudo lvs
    💡 Tip: LVs can be resized online in most cases, which is a major advantage of LVM over fixed partitions.
  5. Step 5: Format, Mount, and Configure Persistence
    🎯 Goal: Format the LV, mount it, and make it persistent via fstab

    💻 Create ext4 filesystem:
    sudo mkfs.ext4 /dev/vgdata/lvapp

    💻 Create mount point:
    sudo mkdir -p /mnt/appdata

    💻 Mount LV:
    sudo mount /dev/vgdata/lvapp /mnt/appdata

    💻 Add fstab entry:
    echo '/dev/vgdata/lvapp /mnt/appdata ext4 defaults 0 2' | sudo tee -a /etc/fstab

    💻 Validate fstab and mounts:
    sudo mount -a
    ⚠️ Warning: A typo in fstab can prevent boot. In production, back up fstab before editing and validate with mount -a.
  6. Step 6: Extend the LV and Resize the Filesystem
    🎯 Goal: Extend lvapp by +2G and resize ext4, then verify size

    💻 Extend LV:
    sudo lvextend -L +2G /dev/vgdata/lvapp

    💻 Resize filesystem:
    sudo resize2fs /dev/vgdata/lvapp

    💻 Verify new size:
    df -h /mnt/appdata
    🎓 Checkpoint: You can provision and expand LVM storage safely — a core LPIC-2 admin skill.

Linux Terminal

Terminal
LVM Dashboard
fstab Viewer
Activity Log
root@storagehost:~#
LVM Objects
Physical Volume (PV)Not created
Volume Group (VG)Not created
Logical Volume (LV)Not created
MountedNo
Storage Table
TypeNamePathSizeStatus
Capacity Gauge
LV Size0G
Filesystem Size0G
/etc/fstab Contents
# /etc/fstab: static file system information. UUID=xxxx-xxxx /boot/efi vfat defaults 0 1 UUID=yyyy-yyyy / ext4 errors=continue 0 1
fstab Notes
ValidationNot validated
Mount Point/mnt/appdata
Recent Activity
[--:--:--]Lab session started. Ready for commands.
Progress: 0/6 tasks completed
Score: 0/100
🎉 After Completing All Steps:

1. Validate configuration to see what tasks are still missing.
2. Use LVM Dashboard + fstab Viewer for visual confirmation.
Tip: Storage tasks are sensitive — follow the step order.
Lab 15: DNS Server Configuration (BIND)
Advanced / Terminal + GUI
Scenario: Stand Up an Internal Authoritative DNS Zone
Your organization is migrating internal services to a dedicated DNS zone. You must deploy an authoritative zone for lab.local, validate configuration files, restart the DNS service, and confirm name resolution with dig. This lab focuses on LPIC-2 network service fundamentals with realistic validation steps.

Learning Objectives:

LPIC-2 202 — Network Services
  • BIND Basics: Understand named, zone files, and config structure
  • Validation: Use named-checkconf and named-checkzone
  • Service Control: Enable and restart named via systemctl
  • DNS Queries: Use dig to test authoritative responses

📋 Step-by-Step Instructions

  1. Step 1: Verify DNS Server Binary and Service Status
    🎯 Goal: Confirm BIND (named) is present and check service state

    💻 Show named version:
    named -v

    💻 Check service status:
    sudo systemctl status named --no-pager
    💡 Tip: In exams, always confirm the service name (named vs bind9) on the target distro.
  2. Step 2: Deploy named.conf with Zone Definition
    🎯 Goal: Copy a prepared configuration file into place (simulated lab workflow)

    💻 Deploy named.conf:
    sudo cp /opt/labs/dns/named.conf /etc/named.conf
    💡 Tip: In real environments you would edit /etc/named.conf and add a zone stanza. This lab uses templates to focus on validation and service operation.
  3. Step 3: Deploy the Zone File
    🎯 Goal: Install the zone file for lab.local

    💻 Deploy zone file:
    sudo cp /opt/labs/dns/db.lab.local /var/named/db.lab.local
    💡 Tip: Zone files are plain text. Be careful with SOA serial numbers in production — increment on changes.
  4. Step 4: Validate Configuration and Zone
    🎯 Goal: Validate config syntax and zone correctness before restart

    💻 Validate named.conf:
    sudo named-checkconf

    💻 Validate the zone file:
    sudo named-checkzone lab.local /var/named/db.lab.local
    ⚠️ Exam Note: Validation commands are fast and prevent outages. Always validate before restarting named.
  5. Step 5: Enable and Restart the DNS Service
    🎯 Goal: Ensure the service starts at boot and apply changes

    💻 Enable named at boot:
    sudo systemctl enable named

    💻 Restart named:
    sudo systemctl restart named
    💡 Tip: If restart fails in production, check logs: journalctl -u named. The Activity Log tab also records lab actions.
  6. Step 6: Query DNS with dig
    🎯 Goal: Confirm authoritative answers for key records

    💻 Query www record:
    dig @localhost www.lab.local

    💻 Query mail record:
    dig @localhost mail.lab.local
    🎓 Checkpoint: You validated and operated a DNS service end-to-end — a core LPIC-2 network service skill.

Linux Terminal

Terminal
Zone Records
named.conf Viewer
Activity Log
root@dnshost:~#
lab.local Zone Records
NameTypeValue
DNS Service Health
Config DeployedNo
Zone File DeployedNo
ValidationPending
Service RestartedNo
/etc/named.conf (simulated)
# named.conf not deployed yet
/var/named/db.lab.local (simulated)
; zone file not deployed yet
Recent Activity
[--:--:--]Lab session started. Ready for commands.
Progress: 0/6 tasks completed
Score: 0/100
🎉 After Completing All Steps:

1. Validate configuration to see what is complete vs pending.
2. Use Zone Records + named.conf Viewer to verify contents.
Tip: Always validate configs before restarting network services.