Skip to content

Lesson 10 — Linux Storage & Disk Management

Lesson 10 — Linux Storage & Disk Management

Section titled “Lesson 10 — Linux Storage & Disk Management”

Imagine you’ve launched a new Linux server in AWS.

Initially, it has a 20 GB disk.

A few months later, your application grows, log files increase, and the database requires more storage.

How do you safely add more disk space without reinstalling Linux?

This is where Linux Storage & Disk Management becomes essential.

Linux provides powerful tools for managing disks, partitions, file systems, and storage volumes. Whether you’re working with cloud virtual machines, enterprise servers, Kubernetes nodes, or databases, understanding Linux storage is a critical administrative skill.

Throughout this lesson, you’ll learn how Linux detects storage devices, creates partitions, formats file systems, mounts disks, and manages enterprise storage using Logical Volume Manager (LVM).


After completing this lesson, you will be able to:

  • Understand Linux storage architecture.
  • Identify disks and partitions.
  • Create and manage file systems.
  • Mount and unmount storage devices.
  • Understand the Linux /etc/fstab file.
  • Learn Logical Volume Management (LVM).
  • Apply enterprise storage management best practices.

Every Linux server stores data on one or more storage devices.

Examples include:

  • Hard Disk Drives (HDD)
  • Solid State Drives (SSD)
  • NVMe Drives
  • USB Storage
  • SAN Storage
  • NAS Storage
  • Cloud Block Storage

Linux treats each storage device as a file under the /dev directory.


A simplified storage architecture looks like this:

Application
File System
Partition
Disk
Storage Hardware

Each layer performs a specific function before data is written to disk.


Linux identifies disks using device names.

Examples:

/dev/sda
/dev/sdb
/dev/sdc
/dev/nvme0n1

Where:

  • sda = First SATA/SCSI disk
  • sdb = Second disk
  • nvme0n1 = NVMe SSD

Display all block devices.

Terminal window
lsblk

Example output:

NAME
sda
├── sda1
├── sda2
└── sda3

This command provides an overview of disks, partitions, and mount points.


Display partition details.

Terminal window
sudo fdisk -l

Example output:

Disk
/dev/sda
100 GB

Administrators use this command before partitioning disks.


A Partition divides a physical disk into logical sections.

Example:

Disk
100 GB
Partition 1
50 GB
Partition 2
50 GB

Each partition can have its own file system.


Linux commonly uses:

  • Primary Partition
  • Extended Partition
  • Logical Partition
  • GPT Partitions

Modern systems typically use the GUID Partition Table (GPT) because it supports larger disks and more partitions.


Before a partition can store files, it must be formatted with a file system.

Common Linux file systems include:

File System Purpose
ext4 Default Linux file system
XFS Enterprise workloads
Btrfs Advanced features
FAT32 USB compatibility
NTFS Windows compatibility

The most common Linux file system is ext4.


Format a partition with ext4.

Terminal window
sudo mkfs.ext4 /dev/sdb1

For XFS:

Terminal window
sudo mkfs.xfs /dev/sdb1

Formatting prepares the partition for storing files.


Linux makes storage available by mounting it to a directory.

Example:

Disk
Partition
Mounted
/data

Mount a partition.

Terminal window
sudo mount /dev/sdb1 /data

Users can now access files through /data.


Display mounted storage.

Terminal window
mount

Or use:

Terminal window
df -h

Example:

Filesystem
Size
Used
Available

This command is commonly used to monitor disk utilization.


Safely detach a mounted file system.

Terminal window
sudo umount /data

Always unmount storage before removing physical devices.


Mounts created manually disappear after reboot.

Permanent mounts are configured in:

/etc/fstab

Example:

UUID=xxxxxxxx
/data
ext4
defaults
0
2

The operating system automatically mounts these file systems during startup.


Display storage UUIDs.

Terminal window
blkid

Using UUIDs is recommended because device names can change after reboots.


Display available storage.

Terminal window
df -h

Example:

Filesystem
Used
Available
Use%

This helps identify low disk space conditions.


Display directory size.

Terminal window
du -sh /var/log

Administrators commonly use this command to locate large directories.


LVM provides flexible storage management.

Instead of using fixed partitions, storage is managed through logical volumes.

Benefits:

  • Resize storage online
  • Combine multiple disks
  • Easier administration
  • Enterprise scalability

Physical Disk
Physical Volume (PV)
Volume Group (VG)
Logical Volume (LV)
File System
Mount Point

This design allows administrators to expand storage without rebuilding the server.


Represents the actual storage device.

Example:

/dev/sdb

A pool of available storage created from one or more physical volumes.

Example:

vg_data

A virtual partition created from a volume group.

Example:

lv_database

Applications use logical volumes instead of physical disks.


Suppose an application requires more disk space.

Traditional partitioning:

Difficult

LVM:

Add New Disk
Extend Volume Group
Extend Logical Volume
Grow File System
Application Continues Running

This flexibility makes LVM the preferred choice for enterprise Linux systems.


Cloud providers offer managed block storage.

  • Amazon EBS
  • Instance Store
  • Amazon EFS
  • Amazon FSx

  • Managed Disks
  • Azure Files
  • Azure NetApp Files

  • Persistent Disk
  • Filestore
  • Hyperdisk

Cloud Engineers regularly attach, resize, and manage these storage services.


Containers require persistent storage.

Examples include:

  • Persistent Volumes (PV)
  • Persistent Volume Claims (PVC)
  • Storage Classes
  • CSI Drivers

Linux storage concepts directly apply to Kubernetes environments.


Security teams investigate:

  • Disk utilization
  • Unauthorized storage devices
  • Sensitive data locations
  • Log storage
  • File system integrity
  • Mounted network shares

Proper storage management supports system reliability and forensic investigations.


Display block devices:

Terminal window
lsblk

Display disk usage:

Terminal window
df -h

Display directory size:

Terminal window
du -sh

Display partition information:

Terminal window
sudo fdisk -l

Display UUIDs:

Terminal window
blkid

Mount storage:

Terminal window
mount

Unmount storage:

Terminal window
umount

A production database server is running out of storage.

The Linux administrator performs the following steps:

Attach New Disk
Verify with lsblk
Create Physical Volume
Extend Volume Group
Extend Logical Volume
Resize File System
Database Continues Running

This operation can often be completed without downtime when using LVM.


As a Linux administrator:

  • Monitor disk utilization regularly.
  • Use UUIDs in /etc/fstab.
  • Prefer GPT partitioning for modern systems.
  • Use LVM for enterprise workloads.
  • Separate application and log storage.
  • Regularly back up important data.
  • Test storage recovery procedures.
  • Monitor file system health and capacity.

Proper storage management improves availability, scalability, and reliability.


After completing this lesson, you should understand:

  • Linux storage architecture.
  • Disks and partitions.
  • File systems.
  • Mounting and unmounting.
  • /etc/fstab.
  • Disk usage monitoring.
  • Logical Volume Management (LVM).
  • Enterprise storage best practices.

Linux Storage & Disk Management is a fundamental skill for every Linux Administrator, Cloud Engineer, and DevOps Engineer.

By understanding disks, partitions, file systems, mounting, and LVM, you’ll be able to build scalable and reliable Linux systems for enterprise applications and cloud infrastructure.

These concepts are used daily when managing AWS EC2 instances, Azure Virtual Machines, Kubernetes clusters, databases, and production Linux servers.


➡️ Lesson 11 — Linux Shell Scripting

In the next lesson, you’ll learn how to automate Linux administration using Bash shell scripting, understand variables, loops, conditions, and functions, and create scripts that simplify repetitive tasks in enterprise environments.