Study guide
7.1 Block Devices, fdisk & gdisk (104.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)
7.1 Block Devices, fdisk & gdisk (104.1)
Key Takeaways Explain This Topic AI
Linux represents physical and virtual storage hardware as block device nodes in /dev/ , classified by subsystem naming conventions: IDE/PATA ( /dev/hd* ), SCSI/SATA/SAS/USB ( /dev/sd* ), NVMe ( /dev/nvmeXnYpZ ), and VirtIO ( /dev/vd* ).
The Master Boot Record (MBR) partition scheme is constrained by a 32-bit Logical Block Addressing limit (max 2 TiB capacity) and supports at most 4 primary partitions (or up to 3 primary and 1 extended partition containing logical partitions numbered 5 and higher).
The fdisk utility operates interactively in memory and commits changes only upon typing w ; essential MBR type hex codes include 83 (Linux), 82 (Swap), 8e (LVM), and fd (RAID auto).
The GUID Partition Table (GPT) scheme utilizes 64-bit LBAs supporting up to 8 ZiB with a default 128 partitions, managed via gdisk using 4-digit hex codes ( 8300 Linux native, 8200 swap, 8e00 LVM, ef00 EFI System Partition).
Changes to partition tables are registered with the running Linux kernel without requiring a system reboot using partprobe or partx .
Last updated: August 2026
7.1 Block Devices, fdisk & gdisk
Quick Summary: In Linux, storage devices are exposed to userspace as special block device nodes within the /dev/ filesystem hierarchy. Storage drives are divided into distinct storage boundaries using either legacy Master Boot Record (MBR/DOS) partition tables or modern GUID Partition Tables (GPT). System administrators manage MBR partitions using fdisk and GPT partitions using gdisk . Because partitioning utilities initially stage alterations in volatile memory, changes must be written to disk and synchronized with the running kernel using tools like partprobe or partx before filesystems can be formatted.
1. Linux Storage Architecture & Block Device Taxonomy
In Unix-like operating systems, the Linux kernel abstracts underlying storage hardware into block devices . Unlike character devices (which stream data sequentially byte-by-byte, such as serial ports or terminal lines), block devices transfer data in fixed-size blocks (typically 512 bytes or 4096 bytes) and support random-access read and write operations via hardware sector addressing.
Block device special files reside in /dev/ and are created dynamically by the udev daemon. You can distinguish block devices in directory listings by the leading b character in the file permission string: $ ls -l /dev/sda /dev/sda1 /dev/tty0
- brw-rw---- 1 root disk 8, 0 Aug 29 10:00 /dev/sda
- brw-rw---- 1 root disk 8, 1 Aug 29 10:00 /dev/sda1
- crw--w---- 1 root tty 4, 0 Aug 29 10:00 /dev/tty0
In the output above, the numbers 8, 0 and 8, 1 represent the major device number (identifying the device driver subsystem, where 8 corresponds to SCSI/SATA disk drivers) and the minor device number (identifying the unique physical drive unit or partition index).
Comprehensive Block Device Naming Conventions
Linux assigns device node names deterministically based on the underlying hardware controller bus and storage protocol:
Device Interface / Subsystem Whole Disk Device Node First Partition Second Partition Technical Architecture & Description
SCSI / SATA / SAS / USB /dev/sda , /dev/sdb /dev/sda1 /dev/sda2 Standard modern storage interfaces managed by the sd_mod kernel SCSI disk driver subsystem. Disk letters increment alphabetically ( a through z , then aa , ab ).
Legacy IDE / PATA /dev/hda , /dev/hdb /dev/hda1 /dev/hda2 Legacy Parallel ATA controllers. Primary Master ( hda ), Primary Slave ( hdb ), Secondary Master ( hdc ), Secondary Slave ( hdd ).
NVMe (PCIe SSD) /dev/nvme0n1 /dev/nvme0n1p1 /dev/nvme0n1p2 Non-Volatile Memory Express storage attached via PCIe. nvme0 is controller index 0, n1 is namespace 1, and p1 designates partition 1.
MMC / SD Cards / eMMC /dev/mmcblk0 /dev/mmcblk0p1 /dev/mmcblk0p2 MultiMediaCard and Secure Digital storage devices. Partition numbers are preceded by the letter p .
VirtIO (KVM / QEMU) /dev/vda , /dev/vdb /dev/vda1 /dev/vda2 Paravirtualized block storage devices optimized for hypervisors running KVM/QEMU Linux virtual machines.
Xen Virtual Disk /dev/xvda , /dev/xvdb /dev/xvda1 /dev/xvda2 Paravirtualized block devices used under the Xen hypervisor architecture.
⚠️ LPIC-1 Trap — NVMe & MMC Partition Syntax: Notice the partition numbering syntax difference: SCSI/SATA partitions append the integer directly to the drive letter ( /dev/sdb1 ), whereas NVMe and MMC/SD device partitions require an explicit p separator before the partition index ( /dev/nvme0n1p1 , /dev/mmcblk0p1 ). Forgetting the p on NVMe device names is a frequent exam mistake.
2. Master Boot Record (MBR / DOS) Partitioning Architecture
The Master Boot Record (MBR) partitioning structure was introduced by IBM in 1983. It is located in the very first 512-byte physical sector (Sector 0, LBA 0) of the storage drive. MBR 512-Byte Sector Layout (LBA 0):
┌────────────────────────────────────────────────────────┬────────────────────────────────────────────┬─────────────┐
- │ Bootstrap Code (446 Bytes) │ Partition Table (64 Bytes) │ Magic Boot │
- │ Primary bootloader stage code │ 4 entries × 16 bytes per entry │ Signature │
- │ │ [Part 1] [Part 2] [Part 3] [Part 4] │ (0x55 0xAA) │
└────────────────────────────────────────────────────────┴────────────────────────────────────────────┴─────────────┘
- 0 446 510 512
- MBR Structural Constraints
The 2 TiB Disk Limit: The MBR partition table allocates exactly 32 bits for the starting sector Logical Block Address (LBA) and 32 bits for the partition sector count. With standard 512-byte sector sizes, 2^32 × 512 bytes = 2,199,023,255,552 bytes = 2 TiB . MBR cannot address or partition disk space beyond 2.19 TB.
Four Primary Partitions Maximum: Because the MBR partition table is only 64 bytes wide and each partition entry requires 16 bytes (64 / 16 = 4), an MBR drive can hold a maximum of 4 Primary Partitions .
Extended & Logical Partitions: To bypass the 4-partition limitation, one primary partition entry can be designated as an Extended Partition (Hex code 0x05 or 0x0f ). The extended partition acts as a container holding a linked list of Extended Boot Records (EBRs) , which define an arbitrary number of Logical Partitions .
MBR Partition Numbering Rules for Linux
Primary Partitions: Always assigned numbers 1 through 4 (e.g., /dev/sda1 , /dev/sda2 , /dev/sda3 , /dev/sda4 ).
Extended Partition: Consumes one of the primary numbers (1 through 4).
Logical Partitions: Always start numbering at 5 (e.g., /dev/sda5 , /dev/sda6 , /dev/sda7 ), regardless of how many primary partitions actually exist on the disk!
💡 LPIC-1 Exam Fill-in-the-Blank Alert: If a SATA disk /dev/sda contains exactly one primary partition ( /dev/sda1 ) and one extended partition ( /dev/sda2 ), what device node name does Linux assign to the first logical partition created inside the extended partition? Answer: /dev/sda5
Loading diagram... MBR vs GPT Storage Layout Architecture
3. Interactive MBR Partitioning with fdisk
The fdisk utility (from the util-linux package) is the traditional, menu-driven command-line partitioning tool for MBR partition tables on Linux.
To partition a block device, execute fdisk followed by the device node path (e.g., fdisk /dev/sdb ): # Launch fdisk on secondary SATA drive
# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.37.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help):
Essential fdisk Interactive Commands Reference
Command Key Operational Function LPIC-1 Exam Significance
m Print the help menu Displays all available single-letter interactive commands.
p Print the partition table Shows current disk size, identifier, geometry, sector count, and all existing partition boundaries.
n Create a new partition Prompts to select partition type ( p for primary, e for extended, or l for logical), partition number, first sector, and last sector.
d Delete a partition Prompts for the partition index number to remove from the in-memory table.
t Change partition system ID Prompts for partition number and the target hex type code (e.g., 83 for Linux, 82 for Swap, 8e for LVM).
l List known partition types Prints all supported partition type hex codes and their descriptive operating system labels.
w Write table to disk and exit Commits all in-memory changes to the physical disk sector and instructs the kernel to re-read the table.
q Quit without saving Exits fdisk immediately, discarding all modifications made during the current interactive session.
v Verify the partition table Scans the partition table for unallocated sectors, overlaps, or structural anomalies.
o Create a new empty DOS table Initializes a blank MBR partition table in memory, erasing existing partition references.
g Create a new empty GPT table Initializes a blank GUID partition table in memory (modern fdisk feature).
Practical fdisk Step-by-Step Partition Creation
When creating a partition with n , specify partition boundaries. Linux administrators almost never calculate raw sector numbers manually for the end boundary; instead, use the +size{K,M,G,T,P} notation: Command (m for help): n
- Partition type
- p primary (0 primary, 0 extended, 4 free)
- e extended (container for logical partitions)
- Select (default p): p
- Partition number (1-4, default 1): 1
- First sector (2048-41943039, default 2048): [Press Enter for 2048]
- Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-41943039, default 41943039): +10G
Created a new partition 1 of type 'Linux' and of size 10 GiB.
- Command (m for help): t
- Selected partition 1
- Hex code or alias (type L to list all): 8e
Changed type of partition 'Linux' to 'Linux LVM'.
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
4. Essential MBR Partition Type Hex Codes
Every MBR partition entry includes a 1-byte system ID (hexadecimal) designating what filesystem or subsystem owns the partition. The LPIC-1 exam requires exact recall of these key codes:
Hex Code Partition System Type Description Operational Role in Linux Administration
83 Linux native filesystem Standard default type for Linux filesystems ( ext2 , ext3 , ext4 , XFS , btrfs ).
82 Linux swap / Solaris Dedicated virtual memory swap partition.
8e Linux LVM Physical Volume (PV) dedicated to the Logical Volume Manager subsystem.
fd Linux RAID auto-detect Software RAID array member managed by mdadm with kernel autodetect support.
05 / 0f Extended Partition Container partition for logical drives ( 05 for CHS addressing, 0f for LBA addressing).
0b / 0c W95 FAT32 / FAT32 (LBA) Windows FAT32 filesystem commonly used on USB flash drives and shared media.
07 HPFS / NTFS / exFAT Windows NT filesystem and Microsoft exFAT storage media.
ef EFI System Partition (ESP) UEFI boot partition formatted as FAT32 containing .efi bootloader binaries.
💡 LPIC-1 Exam Fill-in-the-Blank Alert: What hexadecimal code must be entered in fdisk to set a partition's type to Linux LVM? Answer: 8e
5. GUID Partition Table (GPT) & gdisk Management
Modern hardware with Unified Extensible Firmware Interface (UEFI) firmware replaces legacy MBR with the GUID Partition Table (GPT) standard (defined under the UEFI specification):
Key Architectural Features of GPT
Massive Capacity & 64-Bit LBAs: GPT utilizes 64-bit logical block addresses, supporting maximum partition and disk capacities up to 8 Zebibytes (8 ZiB = 9.44 x 10^21 bytes) .
Arbitrary Partition Count: The standard GPT specification reserves 33 sectors for partition entries. With each entry sized at 128 bytes, GPT natively supports 128 primary partitions by default without requiring extended or logical containers.
Redundant Backup Headers: GPT writes a Primary GPT Header at LBA 1 and duplicates the entire table as a Secondary (Backup) GPT Header at the final physical sectors of the disk, protecting against header corruption.
Protective MBR (LBA 0): GPT places a legacy MBR structure at LBA 0 with a single partition of type 0xee covering the entire disk. This prevents legacy MBR-only tools from misidentifying the disk as blank and overwriting data.
Globally Unique Identifiers (GUIDs): Every GPT partition is assigned a unique 128-bit GUID (e.g., UUID="a1b2c3d4-..." ), allowing persistent identification regardless of hardware bus reordering.
The gdisk (GPT fdisk) Utility
gdisk provides an interactive, text-mode command interface specifically engineered for GPT disks, matching the keystroke semantics of fdisk : # Launch gdisk on secondary drive
- # gdisk /dev/sdb
- GPT fdisk (gdisk) version 1.0.8
Partition table scan:
- MBR: protective
- BSD: not present
- APM: not present
- GPT: present
Found valid GPT with protective MBR; using GPT.
Command (? for help):
gdisk Commands & 4-Digit Hex Codes
While gdisk shares standard commands ( p print, n new, d delete, w write, q quit, v verify), it introduces the x command to access the expert / advanced functionality menu (for partition table alignment, GUID alteration, and backup header recovery).
Furthermore, gdisk uses 4-digit hexadecimal type codes by taking the legacy 2-digit MBR code and appending 00 :
- gdisk 4-Digit Code Partition Type Equivalent MBR Code
- 8300 Linux filesystem ( ext4 , xfs , btrfs ) 83
- 8200 Linux swap 82
- 8e00 Linux LVM 8e
- ef00 EFI System Partition (ESP) ef
- fd00 Linux RAID fd
- 0700 Microsoft basic data (NTFS / FAT) 07
- 6. Partition Discovery & Kernel Table Synchronization
When you modify and write a partition table on an active system, the Linux kernel may still hold the old partition map in memory if any partition on that device is currently mounted. If the kernel cannot automatically reload the table, fdisk outputs the warning: WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at the next reboot.
To force the running Linux kernel to re-read the partition table without rebooting the server, administrators use partprobe or partx .
1. partprobe
Part of the GNU parted package, partprobe requests that the operating system kernel re-read the partition tables on all disks or a specific block device: # Inform kernel of partition changes on all attached drives
# partprobe
- # Inform kernel of partition changes on a specific device
- # partprobe /dev/sdb
- 2. partx
Part of util-linux , partx tells the kernel driver about the presence and numbering of on-disk partitions: # Update the kernel's partition table map for /dev/sdb
# partx -u /dev/sdb
- # Add all partitions found on /dev/sdb to the kernel map
- # partx -a /dev/sdb
- # Delete partition 3 from the kernel's runtime device map
- # partx -d --nr 3 /dev/sdb
3. lsblk and blkid for Partition Discovery # List all block devices in a visual hierarchy with filesystem types and UUIDs
- $ lsblk -f
- NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
- sda
- ├─sda1 vfat FAT32 BOOT 5A21-098F 480.2M 6% /boot/efi
- ├─sda2 ext4 1.0 ROOT a28b12f4-7e11-42b8-a6d1-817290123456 38.4G 42% /
- └─sda3 swap 1 SWAP d1e02934-8c01-4478-b112-998877665544 [SWAP]
- sdb
- └─sdb1 xfs DATA 7f31c201-3810-47b2-8431-a0b1c2d3e4f5 192.5G 3% /mnt/data
- # Inspect block device attributes including UUID and filesystem TYPE
- # blkid /dev/sda2
- /dev/sda2: UUID="a28b12f4-7e11-42b8-a6d1-817290123456" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="00084321-02"
💡 LPIC-1 Exam Fill-in-the-Blank Alert: What utility informs the Linux operating system kernel of partition table changes without requiring a system reboot? Answer: partprobe (or partx )