Skip to main content

Ubuntu Handbook

Chapter #18: Storage Management and File Systems

In this chapter, you'll learn professional storage management skills, including choosing the right file system, managing disks with LVM, configuring RAID for redundancy, and encrypting drives with LUKS.

In the previous chapter, we developed advanced system administration skills, including monitoring, performance tuning, systemd service management, log analysis, and backup strategies.

Now we're going deeper into one of the most critical aspects of system administration: storage management, which is the foundation of your Ubuntu system, where all your user files, applications, databases, configuration files, and important system files reside, so having good, reliable, well-managed storage is crucial.

Think of storage management as being an architect for your data: you decide how to organize space through partitioning, what structure to use through file systems, how to protect against failures through RAID, how to secure sensitive information through encryption, and how to expand when you need more space through LVM (Logical Volume Manager).

Poor storage decisions can lead to data loss, performance bottlenecks, and recovery nightmares, while good storage architecture provides reliability, flexibility, and performance that scales with your needs.

In this chapter, we'll cover:

  • File System Comparison - ext4, Btrfs, and ZFS capabilities and use cases.
  • LVM Fundamentals - flexible disk management with logical volumes.
  • RAID Configuration - data redundancy and performance optimization.
  • LUKS Encryption - protecting data at rest with full-disk encryption.

By the end of this chapter, you'll be able to architect storage solutions like a professional system administrator.

Prerequisites

Before we begin, make sure you have:

  • Administrative sudo access is required to perform all storage-related operations.
  • You'll need at least three spare disks (or partitions): one for ext4 examples, one for Btrfs, and one for ZFS. Minimum 10GB each for testing; 100GB+ recommended for practical examples
  • At least 2GB for ext4 and Btrfs operations; 8GB+ recommended for ZFS (ZFS needs approximately 1GB RAM per TB of storage)
  • Familiarity with concepts such as partitions, volumes, and mount points.
  • Storage operations can be destructive; always back up critical data beforehand.
  • Perform exercises on non-critical systems before working with production storage.
  • Extensive use of terminal commands will be required for storage management.
πŸ’‘
Critical Warning: The commands in this chapter can permanently delete data. Always verify device names with lsblk before running destructive commands, and never practice on disks containing important data without backups.

Understanding Linux File Systems

A file system is the method your operating system uses to store, organize, and retrieve data on your disks. Think of it as the organizational structure that manages how your files are written to storage and read back when needed.

Choosing the right file system is a fundamental decision that impacts your system's performance, reliability, and capabilities.

Different file systems offer different features, and understanding these differences helps you make the right choice for your needs.

ext4: The Reliable Standard

Ext4, which stands for Fourth Extended File System, serves as Ubuntu's default file system and has proven its reliability through over a decade of widespread production use across millions of systems.

Key Features:

  • Proven Stability: Extensively tested and trusted across millions of deployments.
  • Solid Performance: Delivers excellent speed for most workloads.
  • Large File Support: Handles individual files up to 16 TB.
  • Massive Volume Capacity: Supports volumes up to 1 EB (exabyte).
  • Journaling Protection: Records changes before writing them, protecting against data loss during system crashes.
  • Universal Compatibility: Works seamlessly across all Linux distributions.

When Ext4 Is the Right Choice:

  • Desktop systems where reliability is your top priority.
  • Servers running databases that require proven stability.
  • Systems that need maximum compatibility with other Linux distributions.
  • Boot partitions (ext4 is always recommended for /boot).
  • Production environments where you need predictable performance.

Creating an Ext4 File System