Copyright (c) 2026 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.

2.2.1. Partitions, Filesystems, and Disk Layout

💡 First Principle: A partition table is a data structure on the disk that tells the OS where each partition starts and ends. Without it, the disk is an undifferentiated block of storage. The partition table format (MBR or GPT) determines how many partitions you can have and how large the disk can be.

Partition Table Formats:
FeatureMBR (Master Boot Record)GPT (GUID Partition Table)
Max disk size2 TB9.4 ZB (effectively unlimited)
Max primary partitions4 (or 3 primary + extended)128 (no extended needed)
RedundancyNoneBackup copy at end of disk
UEFI requiredNo (legacy BIOS)Recommended (required for Secure Boot)
Toolfdiskgdisk or parted
Partition Management Commands:
lsblk                          # List block devices in tree format
lsblk -f                       # Include filesystem type and UUID
blkid                          # Show UUID and filesystem type for all devices
blkid /dev/sda1                # Show specific partition
fdisk /dev/sda                 # Interactive MBR partitioning
gdisk /dev/sda                 # Interactive GPT partitioning
parted /dev/sda print          # Non-destructive: show partition table
parted /dev/sda mklabel gpt    # Create new GPT partition table
parted /dev/sda mkpart primary ext4 1MiB 50GiB  # Create partition
growpart /dev/sda 1            # Extend a partition to fill available space
Filesystem Types:
FilesystemStrengthsTypical Use
ext4Mature, stable, journaling, widely supportedGeneral-purpose; default on many Debian-based systems
xfsHigh performance, excellent for large files, online grow onlyRHEL default; databases, media storage
btrfsCopy-on-write, snapshots, built-in RAIDAdvanced use cases; openSUSE default
tmpfsRAM-backed; lost on reboot/tmp, /run, shared memory
Filesystem Operations:
mkfs.ext4 /dev/sda1            # Format as ext4
mkfs.xfs /dev/sdb1             # Format as xfs
mkfs.btrfs /dev/sdc1           # Format as btrfs

fsck /dev/sda1                 # Check and repair ext4 (must be unmounted)
xfs_repair /dev/sdb1           # Check and repair xfs (must be unmounted)

df -h                          # Disk space usage by mounted filesystem
df -i                          # Inode usage (critical for "disk full" when du shows space)
du -sh /var/log                # Directory size summary
du -sh /* | sort -h            # Find largest directories at root level

resize2fs /dev/sda1            # Grow/shrink ext4 after partition resize
xfs_growfs /data               # Grow xfs filesystem (online, use mount point not device)
fio                            # Flexible I/O benchmarking tool

Inodes: Every file and directory is represented by an inode — a metadata record containing permissions, timestamps, ownership, and pointers to data blocks. Filesystems have a fixed number of inodes allocated at creation. A disk can fill up on inodes (too many small files) even when block space is available. df -i shows inode exhaustion.

⚠️ Exam Trap: xfs_growfs operates on the mount point, not the device — xfs_growfs /data not xfs_growfs /dev/sdb1. Also, XFS can only grow online, never shrink. resize2fs for ext4 operates on the device. Mixing these up is a guaranteed wrong answer.

Reflection Question: A server reports "no space left on device" errors, but df -h shows 40% free space on the relevant partition. What command reveals the actual problem and what is the most likely cause?

Alvin Varughese
Written byAlvin Varughese
Founder18 professional certifications