Study guide
3.1 Hard Disk Layout, Partition Schemes & Swap Design (102.1)
LPIC-1 Linux Administrator — Exam 101 101-500
Track your progress as you read
Finished sections get a check mark.
1 Exam Overview & Study Strategy
1.1 LPIC-1 101-500 Exam Structure & Blueprint 1.2 Command Line & Shell Fundamentals for Exam Success 1.3 Fill-in-the-Blank Strategies & Common Traps
2 Topic 101: System Architecture
2.1 Hardware Discovery, Sysfs, Procfs & Kernel Modules (101.1) 2.2 Udev, Dbus & Device Management (101.1) 2.3 BIOS vs. UEFI & System Boot Process (101.2) 2.4 Kernel Initialization, Initramfs & System Logs (101.2) 2.5 Systemd Boot Targets & Unit Management (101.3) 2.6 SysVinit Runlevels, Telinit & System Shutdown (101.3)
3 Topic 102: Linux Installation & Boot Management
3.1 Hard Disk Layout, Partition Schemes & Swap Design (102.1) 3.2 LVM & Standard Mount Point Allocation (102.1) 3.3 GRUB 2 Configuration & Troubleshooting (102.2) 3.4 Legacy GRUB & Alternative Boot Loaders (102.2) 3.5 Managing Shared Libraries & ldconfig (102.3) 3.6 Linux as a Virtualization Guest & Cloud Instances (102.6)
4 Topic 102: Package Management Systems
4.1 Debian Low-Level Package Management with dpkg (102.4) 4.2 High-Level Debian Package Management: apt, apt-get & apt-cache (102.4) 4.3 RPM Package Management with rpm (102.5) 4.4 YUM, DNF & Zypper Package Management (102.5) 4.5 Package Repositories & Integrity Verification (102.4/102.5) 4.6 Universal Linux Packages: Snap, Flatpak & AppImage (102.4/102.5)
5 Topic 103: Command Line & Text Processing
5.1 Shell Environment, Environment Variables & Aliases (103.1) 5.2 Command History, Quoting & Expansion (103.1) 5.3 Basic Text Filters: cat, head, tail, cut, paste, nl, od (103.2) 5.4 Advanced Text Filters: sort, uniq, wc, tr, split, less & Checksums (103.2) 5.5 Stream Editing with sed (103.2) 5.6 Basic File Management: cp, mv, rm, touch, mkdir, rmdir (103.3) 5.7 Archiving and Compression: tar, gzip, bzip2, xz, cpio & dd (103.3)
6 Topic 103: Streams, Processes, Regex & Vi
6.1 Standard Streams, Redirection & File Descriptors (103.4) 6.2 Pipelines, tee & xargs (103.4) 6.3 Process Monitoring: ps, top, free, watch, pgrep, pstree & uptime (103.5) 6.4 Signals, kill, Job Control, nohup, screen & tmux (103.5) 6.5 Process Priorities: nice & renice (103.6) 6.6 Regular Expressions & grep, egrep, fgrep (103.7) 6.7 vi / vim Modes, plus nano, Emacs & EDITOR Awareness (103.8)
7 Topic 104: Devices, Partitions & Filesystems
7.1 Block Devices, fdisk & gdisk (104.1) 7.2 GNU Parted & Partition Table Management (104.1) 7.3 Creating Filesystems: mkfs, ext4, XFS, VFAT/exFAT & Btrfs (104.1) 7.4 Filesystem Integrity: fsck, e2fsck, xfs_repair, xfs_fsr & xfs_db (104.2) 7.5 Monitoring Disk Usage: df, du & tune2fs (104.2) 7.6 Managing Swap Space: mkswap, swapon & swapoff (104.1/104.2)
8 Topic 104: Mounts, Permissions, Links & FHS
8.1 Mounting and Unmounting Filesystems: mount & umount (104.3) 8.2 Persistent Mounts: /etc/fstab, UUIDs & systemd mount units (104.3) 8.3 Standard File Permissions: chmod, chown, chgrp & umask (104.5) 8.4 Special Permissions: SUID, SGID & Sticky Bit (104.5) 8.5 Hard Links vs. Symbolic Links: ln & Inodes (104.6) 8.6 Filesystem Hierarchy Standard (FHS) & File Location (104.7)
3.1 Hard Disk Layout, Partition Schemes & Swap Design (102.1)
Key Takeaways Explain This Topic AI
Separating mount points like /boot, /home, /var, /var/log, and /tmp isolates dynamic file growth, protects the root (/) filesystem from space exhaustion, and enables granular security mount options.
/boot holds kernel binaries (vmlinuz) and initial ramdisks (initramfs) and must use a standard, unencrypted filesystem (ext2/ext3/ext4) accessible by firmware and bootloaders.
UEFI systems mandate a dedicated EFI System Partition (ESP) formatted as FAT32 (vfat) mounted at /boot/efi with partition type EF00 (GPT) or EF (MBR).
/tmp should be secured using mount options noexec, nosuid, and nodev to prevent execution of unauthorized scripts and privilege escalation exploits.
The vm.swappiness sysctl parameter (range 0–100 or 0–200) controls kernel aggressiveness in paging anonymous memory to swap versus dropping page cache; low values favor RAM retention for low-latency databases.
Last updated: August 2026
3.1 Hard Disk Layout, Partition Schemes & Swap Design (102.1)
Quick Summary: Designing an enterprise Linux partition layout requires balancing workload requirements, system resilience, and security hardening. Isolating directories such as /boot , /home , /var , /var/log , and /tmp onto dedicated filesystems prevents runaway log files or user uploads from exhausting disk space on the root ( / ) filesystem. Furthermore, proper swap space sizing and vm.swappiness kernel tuning ensure reliable virtual memory management and system stability under heavy load.
1. Principles of Storage Layout Design
When installing a Linux system, administrators must determine whether to place all files on a single monolithic root ( / ) partition or divide the directory tree across multiple dedicated partitions or Logical Volume Manager (LVM) logical volumes. While a single-partition layout is simple and suitable for personal desktop testing, production servers demand multi-partition or multi-volume architectures.
Workload-Specific Layout Architectures
Workload Type Critical Directory Allocations Architectural Rationale
Database Server (PostgreSQL, MySQL, Oracle) Large dedicated /var/lib/mysql or /var/lib/pgsql , isolated /var/log , separate /opt Database data files experience heavy random I/O; isolating them prevents transaction log growth from choking system processes. Dedicated mounts allow custom filesystem tuning (e.g., noatime , nodiratime ).
Web / Application Server Dedicated /var/www , /srv , /var/log/nginx or /var/log/httpd , isolated /tmp Web assets and access logs scale rapidly. Isolating /var/log prevents denial-of-service (DoS) from disk exhaustion during traffic spikes or HTTP flood attacks.
Multi-User / Development Workstation Large dedicated /home , isolated /tmp with nosuid,nodev , /usr/local Multiple developers compiling source code and storing local repositories can easily consume disk capacity. Isolating /home preserves user data during operating system upgrades.
High-Security / Hardened Server Isolated /tmp , /var/tmp , /var/log , /var/log/audit , /home with restricted mount flags Implements strict least-privilege security controls. World-writable directories are mounted with noexec,nosuid,nodev to neutralize binary execution exploits.
2. Dedicated Partitions Rationale & Filesystem Hierarchy
The Filesystem Hierarchy Standard (FHS) defines the structure and purpose of directories in Linux. Isolating specific directories onto dedicated block devices provides three primary benefits: fault isolation , data preservation , and security enforcement . ┌────────────────────────┐
- │ / (Root) │
- │ Core System Binaries │
- └───────────┬────────────┘
- ┌──────────────┬───────┴───────┬──────────────┬──────────────┐
- ▼ ▼ ▼ ▼ ▼
- ┌────────────┐ ┌────────────┐ ┌────────────┐ ┌────────────┐ ┌────────────┐
- │ /boot │ │ /home │ │ /var │ │ /tmp │ │ /opt │
- │ Kernels, │ │ User Data, │ │ Logs, Spool│ │ Temp Files │ │ 3rd-Party │
- │ Initramfs │ │ Quotas │ │ Databases │ │noexec,nosuid│ │ Add-on PKG │
- └─────┬──────┘ └────────────┘ └─────┬──────┘ └────────────┘ └────────────┘
- ▼ ▼
- ┌────────────┐ ┌────────────┐
- │ /boot/efi │ │ /var/log │
- │ UEFI ESP │ │ Audit Logs │
- │ FAT32 │ │ Isolation │
- └────────────┘ └────────────┘
- Detailed Mount Point Specifications
Root ( / ): Contains the operating system core ( /bin , /sbin , /lib , /etc ). If / runs out of free space or inodes, the Linux kernel cannot allocate file descriptors, write temporary sockets, or spawn processes, leading to complete system lockup.
/boot : Holds Linux kernel binaries ( vmlinuz-* ), initial RAM disk images ( initramfs-* or initrd-* ), and bootloader assets ( /boot/grub/ ).
Must be accessible by the system BIOS or bootloader before device drivers or LVM modules are loaded.
Must reside on an unencrypted, standard filesystem (typically ext4 , ext3 , or ext2 ).
Recommended size: 500 MiB to 2 GiB to accommodate multiple kernel versions.
/boot/efi : The EFI System Partition (ESP) mandated on UEFI-based systems.
Must be formatted as FAT32 ( vfat ).
Partition type code: EF00 in GPT ( gdisk ) or 0xEF in MBR ( fdisk ).
Recommended size: 100 MiB to 512 MiB .
/home : Contains user personal directories, dotfiles, and application configurations.
Isolating /home ensures that re-installing or upgrading the Linux OS does not overwrite user data.
Enables filesystem quota management ( usrquota , grpquota ).
/var and /var/log : Stores variable data including system logs ( /var/log ), mail queues ( /var/spool/mail ), package caches ( /var/cache/apt , /var/cache/dnf ), and database storage ( /var/lib/mysql ).
Runaway daemon logging or print queues can quickly fill gigabytes of storage. Isolating /var or /var/log ensures log flooding never exhausts the root filesystem.
/tmp : World-writable directory ( drwxrwxrwt with sticky bit) used by applications for ephemeral scratch files.
Highly vulnerable to security exploits where malicious users download and execute unauthorized binaries.
Frequently mounted as tmpfs (RAM-backed volatile filesystem) or an isolated partition with restrictive mount flags.
/opt and /srv : /opt holds self-contained third-party software suites (e.g., /opt/google/chrome , /opt/gitlab ); /srv holds site-specific data served by network protocols (e.g., /srv/www , /srv/ftp ).
/usr : Historically placed on a separate partition containing user utilities and shared libraries ( /usr/bin , /usr/lib , /usr/share ). Modern systemd-based distributions require /usr to be mounted inside the initramfs stage before switching root.
💡 LPIC-1 Exam Fill-in-the-Blank Alert: When asked which directory stores architecture-independent shared data such as man pages, documentation, and icons, the answer is /usr/share .
When asked which filesystem type is mandatory for the UEFI EFI System Partition (ESP), the answer is vfat (or FAT32 ).
3. Filesystem Security Mount Options
Hardening dedicated filesystems in /etc/fstab prevents common attack vectors such as SUID binary exploitation and unauthorized script execution.
Mount Option Security Function Recommended Target Mounts
nodev Prevents the creation or interpretation of block or character special device files. /home , /tmp , /var , /var/tmp
nosuid Disables the operation of SUID (Set User ID) and SGID (Set Group ID) execution bits. /home , /tmp , /var , /var/tmp , /boot
noexec Blocks direct execution of any binary or executable script on the filesystem. /tmp , /var/tmp , /dev/shm
ro Mounts the filesystem as read-only. /boot (after maintenance), ISO images, audit backups
noatime Disables writing file access timestamps, reducing I/O write overhead. High-performance database mounts, SSD storage
⚠️ LPIC-1 Trap: Mounting /tmp with noexec may cause package managers or compiler tools (e.g., gcc , apt , dnf ) that rely on building temporary executables in /tmp to fail unless redirected using TMPDIR=/var/tmp .
4. Swap Space Architecture, Sizing & Configuration
Swap space provides virtual memory backing when physical RAM is fully committed. The Linux kernel's memory management subsystem moves inactive (anonymous) memory pages from physical RAM into swap, freeing physical RAM frames for active execution and high-priority filesystem page caching.
Swap Sizing Reference Guide
- Physical RAM Installed Recommended Swap (No Hibernation) Recommended Swap (With Hibernation / Suspend-to-Disk)
- <= 2 GiB 2 × RAM 3 × RAM
- 2 GiB – 8 GiB 1 × RAM 2 × RAM
- 8 GiB – 64 GiB 4 GiB to 0.5 × RAM 1 × RAM + 2 GiB margin
- > 64 GiB 4 GiB to 16 GiB (fixed) Not recommended for hibernation; 1 × RAM if mandated
- Swap Partition vs. Swap File
Swap Partition: A dedicated raw disk slice formatted with partition type 82 (MBR) or 8200 (GPT). Provides optimal contiguous disk sector performance.
Swap File: A pre-allocated regular file on an existing filesystem. Highly flexible because it can be created, resized, or deleted dynamically without repartitioning. # Creating and activating a 4 GiB swap file
- sudo fallocate -l 4G /swapfile
- # Secure permissions (critical: only root can read/write)
- sudo chmod 600 /swapfile
- # Format the file as Linux swap area
- sudo mkswap /swapfile
- # Activate the swap file
- sudo swapon /swapfile
- # Verify active swap allocations
- swapon --show
- free -h
- cat /proc/swaps Filename Type Size Used Priority
- /dev/sda3 partition 4194300 0 -2
- /swapfile file 4194304 0 -3
To make the swap file persistent across reboots, add the following entry to /etc/fstab : /swapfile none swap sw 0 0
5. Kernel Swappiness Tuning ( vm.swappiness )
The Linux kernel parameter vm.swappiness defines the relative balance between paging out anonymous application memory to swap versus reclaiming active/inactive page cache (file-backed pages).
Value Range: 0 to 100 (up to 200 in Linux kernel 5.8+ with cgroups v2).
Default Value: 60 on most enterprise distributions (Debian, Ubuntu, RHEL).
Low Values (e.g., 1 – 10 ): The kernel aggressively avoids swapping anonymous memory pages, preferring to drop reclaimable filesystem cache. Essential for latency-sensitive databases (e.g., MySQL, Redis, SAP HANA) to prevent query stalls.
High Values (e.g., 80 – 100 ): The kernel aggressively pages out idle process memory to swap, maximizing free physical RAM for filesystem buffering and I/O throughput.
Value of 0 : Disables swapping completely until the system reaches an absolute out-of-memory (OOM) condition. # Inspect current runtime swappiness
- cat /proc/sys/vm/swappiness
- # OR using sysctl
- sysctl vm.swappiness
- # Temporarily set swappiness to 10 (reverts on reboot)
- sudo sysctl vm.swappiness=10
- # Make swappiness persistent across reboots in /etc/sysctl.d/99-swappiness.conf
- echo 'vm.swappiness = 10' | sudo tee /etc/sysctl.d/99-swappiness.conf
- sudo sysctl --system