LPIC-1 Labs

Intermediate Linux system administration aligned to LPIC-1 (Exams 101 & 102). Disk management, networking, and process control hands-on labs.

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-1 Labs - Module 3

Disk partitioning & filesystems, network configuration, and process management — core LPIC-1 exam topics.

Lab 7: Disk Partitioning & Filesystem Management
Intermediate / Terminal + GUI
Scenario: Prepare Additional Storage for a File Server
Your infrastructure team has added a new 20 GB disk (/dev/sdb) to the file server. You must partition the disk, create an ext4 filesystem, mount it to /mnt/data, configure persistent mounting via /etc/fstab, and verify everything works after a simulated reboot. This is a fundamental sysadmin task tested on LPIC-1.

Learning Objectives:

LPIC-1 101 — Topic 104
  • Block Devices: Use lsblk and fdisk to inspect and partition disks
  • Filesystem Creation: Format partitions with mkfs.ext4
  • Mount/Unmount: Mount filesystems and verify with df
  • Persistent Mounts: Edit /etc/fstab for boot-time mounting

📋 Step-by-Step Instructions

  1. Step 1: Identify Available Disks & Partitions
    🎯 Goal: Discover all block devices and their current partition layouts

    📝 What is lsblk?
    lsblk lists information about all block devices (disks, partitions, loop devices). It shows device names, sizes, types, and mount points in a tree format. This is the first command to run when managing storage.

    💻 List all block devices:
    lsblk

    💻 View partition details for /dev/sdb:
    sudo fdisk -l /dev/sdb

    🔍 What to look for:
    sda is your primary disk (OS), sdb is the new disk
    • sdb should show 20G with no partitions yet
    • The TYPE column tells you if it's a disk or partition (part)
    💡 Tip: lsblk is safer than fdisk -l for a quick overview — it doesn't require root privileges and never modifies anything.
    📖 Hint: Check the Disk Manager GUI tab — it visualizes your partition layout and mount status in real-time.
  2. Step 2: Create a New Partition on /dev/sdb
    🎯 Goal: Create a single primary partition using the entire 20 GB disk

    📝 How fdisk works:
    In a real environment, fdisk /dev/sdb opens an interactive menu where you press n (new), p (primary), accept defaults, then w (write). In this lab, the process is simulated with a single command. After partitioning, partprobe tells the kernel to re-read the partition table.

    💻 Create partition (simulated interactive fdisk):
    sudo fdisk /dev/sdb

    💻 Inform kernel of partition changes:
    sudo partprobe

    💻 Verify the new partition exists:
    lsblk /dev/sdb
    💡 Tip: In the real exam, fdisk is interactive. Key presses: n → new, p → primary, 1 → partition number, Enter → default start/end, w → write and exit.
    ⚠️ Exam Note: partprobe is essential after fdisk — without it, the kernel doesn't see the new partition until reboot. Know this for LPIC-1!
  3. Step 3: Format the Partition with ext4
    🎯 Goal: Create an ext4 filesystem on the new partition and verify with blkid

    📝 What is ext4?
    ext4 (fourth extended filesystem) is the default Linux filesystem. It supports files up to 16 TB, volumes up to 1 EB, journaling, and extents. mkfs.ext4 creates the filesystem structure on a raw partition.

    💻 Create ext4 filesystem:
    sudo mkfs.ext4 /dev/sdb1

    💻 Verify filesystem UUID and type:
    sudo blkid /dev/sdb1
    💡 Tip: blkid shows the UUID, which is more reliable than device names for fstab. Device names can change between boots!
  4. Step 4: Create Mount Point & Mount the Filesystem
    🎯 Goal: Mount the new partition to /mnt/data and verify

    📝 What is mounting?
    Mounting attaches a filesystem to a directory in the Linux directory tree. The directory (mount point) must exist before mounting. df -h shows all mounted filesystems with human-readable sizes.

    💻 Create the mount point directory:
    sudo mkdir -p /mnt/data

    💻 Mount the partition:
    sudo mount /dev/sdb1 /mnt/data

    💻 Verify the mount:
    df -h /mnt/data
    💡 Tip: -p in mkdir -p creates parent directories as needed and doesn't error if the directory already exists. Always use it!
    📖 Hint: Watch the Disk Manager tab — the mount status for sdb1 changes from "unmounted" to "mounted" with the mount point shown.
  5. Step 5: Configure Persistent Mount in /etc/fstab
    🎯 Goal: Add the mount to fstab so it persists across reboots

    📝 What is /etc/fstab?
    The filesystem table (/etc/fstab) tells Linux what to mount at boot. Each line specifies: device, mount point, filesystem type, options, dump, pass. A mistake here can prevent booting — always back up first!

    💻 Backup current fstab:
    sudo cp /etc/fstab /etc/fstab.bak

    💻 Add the new mount entry:
    echo '/dev/sdb1 /mnt/data ext4 defaults 0 2' | sudo tee -a /etc/fstab

    💻 Verify the fstab entry:
    cat /etc/fstab
    ⚠️ Warning: A typo in fstab can make the system unbootable! Always use sudo cp /etc/fstab /etc/fstab.bak before editing. On the exam, backup first!
    💡 Exam Tip: fstab fields: device mountpoint fstype options dump pass. Pass=0 means no fsck, pass=1 for root, pass=2 for others.
  6. Step 6: Verify Persistent Mount & Final Check
    🎯 Goal: Test that fstab works by re-mounting all and doing a final verification

    💻 Re-mount everything from fstab:
    sudo mount -a

    💻 Full disk overview with filesystem info:
    lsblk --fs

    🔍 What to verify:
    • sdb1 shows ext4 filesystem type
    • Mount point is /mnt/data
    • No errors from mount -a (validates fstab syntax)
    • UUID matches what blkid showed earlier
    🎓 Checkpoint: You can now partition disks, create filesystems, mount them, and make mounts persistent — essential skills for LPIC-1 Topic 104!

Linux Terminal

Terminal
Disk Manager
fstab Viewer
Activity Log
sysadmin@fileserver:~$
Block Devices
DeviceSize / TypeFSMountStatus
sda40G diskOS Disk
├ sda1512M partvfat/boot/efimounted
└ sda239.5G partext4/mounted
sdb20G diskunpartitioned
Storage Summary
Total Disks2
Total Capacity60 GB
Mounted Partitions2
Unmounted1 (sdb)
/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 Field Reference
Field 1Device / UUID
Field 2Mount Point
Field 3Filesystem Type
Field 4Options
Field 5Dump (0/1)
Field 6Pass (0/1/2)
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 which tasks are complete and which remain.
2. Check the Disk Manager and fstab Viewer tabs for live storage dashboards.
💡 Tip: The Activity Log records every command with timestamps!
Lab 8: Network Configuration & Troubleshooting
Intermediate / Terminal + GUI
Scenario: Configure Static Networking for a Server
The server currently has no IP configuration on its primary interface eth0. You need to assign a static IP address (192.168.1.100/24), set the default gateway (192.168.1.1), configure DNS resolution (8.8.8.8), test connectivity to the gateway and external hosts, and verify the full network stack is operational.

Learning Objectives:

LPIC-1 102 — Topic 109
  • IP Configuration: Assign static IPs using the ip command
  • Routing: Configure default gateway and view routing table
  • DNS: Configure name resolution via /etc/resolv.conf
  • Troubleshooting: Use ping and traceroute to diagnose connectivity

📋 Step-by-Step Instructions

  1. Step 1: Inspect Current Network Interfaces
    🎯 Goal: View all network interfaces and their current state

    📝 What is ip addr?
    The ip command is the modern replacement for ifconfig. ip addr show displays all interfaces with their IP addresses, MAC addresses, and state. ip link show focuses on link-layer info (up/down status, MTU).

    💻 Show all interfaces with IPs:
    ip addr show

    💻 Show link-layer status:
    ip link show

    🔍 What to look for:
    lo = loopback (always present, 127.0.0.1)
    eth0 = primary Ethernet interface — should show NO IP address yet
    • State: UP means the interface is active at the hardware level
    💡 Tip: ip addr show replaces the deprecated ifconfig. On LPIC-1 and modern distros, always use ip commands!
    📖 Hint: Check the Network Dashboard tab — it visualizes interface states, IPs, and routes in real-time.
  2. Step 2: Assign a Static IP Address
    🎯 Goal: Configure 192.168.1.100/24 on eth0

    📝 CIDR notation:
    /24 means a 255.255.255.0 subnet mask — the first 24 bits are the network portion. This gives you 254 usable host addresses (192.168.1.1 through 192.168.1.254).

    💻 Add IP address to eth0:
    sudo ip addr add 192.168.1.100/24 dev eth0

    💻 Verify the IP is assigned:
    ip addr show eth0
    💡 Tip: ip addr add adds an IP without removing existing ones. Use ip addr del to remove. These changes are temporary — they don't survive reboot.
    ⚠️ Exam Note: Know the difference: ip addr add (runtime only) vs editing /etc/network/interfaces or Netplan (persistent). LPIC-1 tests both!
  3. Step 3: Configure the Default Gateway
    🎯 Goal: Set the default route so traffic can leave the local network

    📝 What is a default gateway?
    The default gateway is the router that forwards packets to networks outside your local subnet. Without it, you can only communicate with devices on the same subnet (192.168.1.x).

    💻 Add default gateway:
    sudo ip route add default via 192.168.1.1

    💻 View the routing table:
    ip route show
    💡 Tip: The routing table shows two key entries: the local subnet route (added automatically when you set the IP) and the default route (gateway you just configured).
  4. Step 4: Configure DNS Resolution
    🎯 Goal: Set up DNS so the server can resolve domain names

    📝 What is /etc/resolv.conf?
    This file tells the system which DNS servers to query. Without it, you can reach IPs but not domain names. nameserver 8.8.8.8 uses Google's public DNS. You can list multiple nameservers for redundancy.

    💻 View current DNS configuration:
    cat /etc/resolv.conf

    💻 Set Google DNS as nameserver:
    sudo sh -c 'echo "nameserver 8.8.8.8" > /etc/resolv.conf'
    💡 Tip: sh -c '...' is needed because the > redirect needs root privileges. sudo echo ... > file won't work because the redirect runs as your user!
    📖 Hint: On modern systems, /etc/resolv.conf may be managed by systemd-resolved or NetworkManager. On LPIC-1, you're expected to know the manual method.
  5. Step 5: Test Connectivity
    🎯 Goal: Verify network connectivity to the gateway and beyond

    📝 Troubleshooting order:
    Always test bottom-up: 1) ping gateway (local connectivity), 2) ping external IP (routing works), 3) ping domain name (DNS works). If step 2 fails but 1 works, the problem is routing.

    💻 Ping the default gateway:
    ping -c 4 192.168.1.1

    💻 Trace route to external host:
    traceroute 8.8.8.8
    💡 Exam Tip: -c 4 limits ping to 4 packets (otherwise it runs forever). On the exam, always use -c to avoid hanging!
  6. Step 6: Final Network Verification
    🎯 Goal: Confirm the entire network stack is configured correctly

    💻 Show all IPs:
    ip addr show

    💻 Show routing table:
    ip route show

    💻 Verify DNS:
    cat /etc/resolv.conf

    🔍 Final checklist:
    • eth0 has 192.168.1.100/24
    • Default route via 192.168.1.1
    • DNS nameserver is 8.8.8.8
    • Gateway ping succeeds
    🎓 Checkpoint: You've configured a complete network stack from scratch — IP, gateway, DNS, and verified connectivity. This covers LPIC-1 Topic 109 (Networking Fundamentals)!

Linux Terminal

Terminal
Network Dashboard
Routing Table
Activity Log
sysadmin@fileserver:~$
Network Interfaces
IfaceIP AddressMACState
lo127.0.0.1/8UP
eth0No IP assigned52:54:00:ab:cd:efUP
Connectivity Status
Gateway ReachableNo
DNS ConfiguredNo
External ConnectivityNo
Routing Table
No routes configured (no IP assigned)
DNS Configuration
NameserverNot configured
Source/etc/resolv.conf
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 check your network configuration.
2. Check the Network Dashboard and Routing Table tabs for live network state.
💡 Tip: The Activity Log tracks every command with timestamps!
Lab 9: Process Management & System Monitoring
Intermediate / Terminal + GUI
Scenario: Investigate & Control a Runaway Server
Users are reporting slow performance on the file server. You need to investigate running processes, identify resource-heavy processes, manage process priorities using nice and renice, send signals to misbehaving processes, and monitor system resources. This is essential troubleshooting covered in LPIC-1.

Learning Objectives:

LPIC-1 101 — Topic 103
  • Process Listing: Use ps and top to view running processes
  • Process Search: Find specific processes with grep and pgrep
  • Priority Control: Adjust process priority with nice/renice
  • Signals: Send signals (SIGTERM, SIGKILL) to control processes

📋 Step-by-Step Instructions

  1. Step 1: View All Running Processes
    🎯 Goal: Get a full snapshot of all processes on the system

    📝 ps aux explained:
    a = show processes from all users, u = user-friendly format (shows USER, %CPU, %MEM), x = include processes without a controlling terminal (daemons). Together, ps aux gives a complete process snapshot.

    💻 List all processes:
    ps aux

    💻 View real-time resource usage (snapshot):
    top -bn1 | head -20

    🔍 What to look for:
    • USER column shows who owns the process
    • %CPU and %MEM show resource consumption
    • PID is the Process ID — you'll need this for signals
    • Look for any process consuming unusually high CPU/MEM
    💡 Tip: top -bn1 means: b = batch mode (non-interactive), n1 = 1 iteration. This is how you use top in scripts!
    📖 Hint: Check the Process Monitor tab — it shows a live process table with CPU/MEM usage and system resource gauges.
  2. Step 2: Find Specific Processes
    🎯 Goal: Locate specific processes by name

    📝 grep vs pgrep:
    ps aux | grep sshd searches ps output for "sshd" (shows full line but may include the grep process itself). pgrep -a nginx directly searches the process table and shows PID + command — cleaner and more reliable.

    💻 Find SSH daemon processes:
    ps aux | grep sshd

    💻 Find Nginx processes with pgrep:
    pgrep -a nginx
    💡 Tip: ps aux | grep sshd will also show the grep command itself. To exclude it: ps aux | grep [s]shd (bracket trick).
  3. Step 3: Manage Process Priority
    🎯 Goal: Launch a low-priority process and adjust its priority

    📝 nice values:
    Nice values range from -20 (highest priority) to +19 (lowest priority). Default is 0. nice -n 10 starts a process with lower priority. renice changes priority of a running process. Only root can set negative nice values (higher priority).

    💻 Start a background process with low priority:
    nice -n 10 sleep 300 &

    💻 Change its priority (requires root):
    sudo renice -n 5 -p 1234
    💡 Tip: The & at the end puts the process in the background. You'll see [1] PID printed — note the PID for later steps!
    ⚠️ Exam Note: Only root can LOWER nice values (increase priority). Regular users can only raise nice values (lower priority). This is a common LPIC-1 question!
  4. Step 4: Send Signals to Processes
    🎯 Goal: Learn to send signals for process control

    📝 Common signals:
    • SIGTERM (15) — graceful termination (process can clean up)
    • SIGKILL (9) — forced kill (cannot be caught or ignored)
    • SIGHUP (1) — reload configuration
    • SIGSTOP (19) — pause process


    💻 List all available signals:
    kill -l

    💻 Gracefully terminate the sleep process:
    kill -15 1234
    💡 Tip: Always try SIGTERM (15) first — it lets the process shut down cleanly. Only use SIGKILL (9) as a last resort, because it doesn't allow cleanup!
  5. Step 5: Monitor System Resources
    🎯 Goal: Check memory, uptime, and virtual memory statistics

    📝 Key monitoring commands:
    free -h shows RAM and swap usage. uptime shows how long the system has been running and load averages. vmstat provides CPU, memory, I/O, and system activity in one view.

    💻 Check memory usage:
    free -h

    💻 Check uptime and load average:
    uptime

    💻 View virtual memory statistics (3 samples, 1s apart):
    vmstat 1 3
    💡 Exam Tip: Load average in uptime shows 1/5/15 min averages. If load > number of CPUs, the system is overloaded. On a 4-core machine, load of 4.0 = 100% utilization.
  6. Step 6: Job Control — Background & Foreground
    🎯 Goal: Manage background jobs using job control commands

    📝 Job control basics:
    jobs lists background jobs. bg resumes a stopped job in background. fg brings a background job to foreground. Ctrl+Z suspends (stops) the current foreground process.

    💻 List background jobs:
    jobs

    💻 Check final process list:
    ps aux | grep sleep
    🎓 Checkpoint: You can now list, find, prioritize, signal, and monitor processes — core skills for LPIC-1 Topic 103 (GNU and Unix Commands)!

Linux Terminal

Terminal
Process Monitor
Resource Gauges
Activity Log
sysadmin@fileserver:~$
Process Table
PIDUSERCOMMAND%CPU%MEM
1root/sbin/init0.10.8
234root/usr/sbin/sshd -D0.00.5
312root/usr/sbin/cron -f0.00.3
450rootnginx: master0.21.2
451www-datanginx: worker0.51.8
680sysadmin-bash0.00.4
Process Summary
Total Processes6
Running6
Background Jobs0
CPU Usage
User12%
Load Average0.45, 0.32, 0.28
Memory
Used / Total1.8 GB / 4 GB
Swap0 MB / 2 GB
Uptime
System Uptime2 days, 14:22
Users Logged In1
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 review process management task status.
2. Check the Process Monitor and Resource Gauges tabs for live system metrics.
💡 Tip: The Activity Log shows every command you ran!