Chapter 9: Linux Storage Administration

15 min read ▅▅ Beginner 📅 Updated July 2026

🎯 Learning Objectives

  • Understand Linux storage architecture[cite: 21].
  • Identify Linux storage devices[cite: 21].
  • Learn MBR and GPT partition tables[cite: 21].
  • Compare common Linux filesystems[cite: 21].
  • Use storage inspection commands[cite: 21].

Why Storage Administration Matters

Storage is where Linux permanently stores operating systems, applications, databases, configuration files and user data[cite: 21]. Every Linux administrator should know how to inspect, manage and troubleshoot storage safely[cite: 21].

🏢 Production Insight

Enterprise servers often use SAN, NAS, cloud block storage or virtual disks[cite: 21]. Administrators are responsible for safely configuring, mounting and expanding these storage resources[cite: 21].

Linux Storage Architecture

Application
     │
Filesystem
     │
Logical Volume (Optional)
     │
Partition
     │
Physical Disk
              
LayerDescription
Physical DiskStorage hardware[cite: 21]
PartitionLogical disk division[cite: 21]
FilesystemOrganizes stored data[cite: 21]
ApplicationReads and writes data[cite: 21]

Linux Device Naming

/dev/sda
/dev/sdb
/dev/nvme0n1
/dev/mapper/vgdata-lvdata
DeviceDescription
/dev/sdaFirst SATA/SCSI disk[cite: 21]
/dev/sdbSecond disk[cite: 21]
/dev/nvme0n1NVMe SSD[cite: 21]
/dev/mapper/*LVM logical volume[cite: 21]

Storage Inspection Commands

lsblk
blkid
fdisk -l
parted -l
cat /proc/partitions

Partition Tables

FeatureMBRGPT
Disk Size~2 TB[cite: 21]>2 TB[cite: 21]
Primary Partitions4[cite: 21]128+[cite: 21]
RecommendedNo[cite: 21]Yes[cite: 21]

Common Linux Filesystems

FilesystemTypical Usage
ext4General-purpose Linux[cite: 21]
XFSEnterprise servers[cite: 21]
BtrfsSnapshots & advanced features[cite: 21]
FAT32USB drives[cite: 21]
NTFSWindows compatibility[cite: 21]

Hands-on Practice

  1. Run lsblk[cite: 21].
  2. Run blkid[cite: 21].
  3. Display partition tables using fdisk -l[cite: 21].
  4. Inspect storage using parted -l[cite: 21].
  5. Review /proc/partitions[cite: 21].

⚠ Common Mistakes

  • Formatting the wrong disk[cite: 21].
  • Confusing disks with partitions[cite: 21].
  • Ignoring UUIDs[cite: 21].
  • Assuming device names never change[cite: 21].

Part 1 Summary

You learned Linux storage architecture, device naming, partition tables, filesystems and essential storage inspection commands[cite: 21]. Part 2 covers partitions, filesystems, mounting and /etc/fstab[cite: 21].

Why Partition Disks?

Partitioning divides a physical disk into logical sections[cite: 21]. Each partition can contain its own filesystem and can be dedicated for operating systems, applications, databases or backups[cite: 21].

🏢 Enterprise Insight

Production Linux servers usually separate /, /boot, /var, /home, database and application storage[cite: 21].

Disk Layout

Physical Disk (/dev/sdb)
│
├── Partition 1 (ext4)
├── Partition 2 (XFS)
└── Partition 3 (LVM PV)
              

Partition Types

TypeDescription
PrimaryMain partition[cite: 21]
ExtendedContainer for logical partitions (MBR)[cite: 21]
LogicalPartitions inside extended partition[cite: 21]
GPTModern partition format supporting very large disks[cite: 21]

MBR vs GPT

FeatureMBRGPT
Maximum Disk Size2 TB[cite: 21]8 ZB[cite: 21]
Partitions4 Primary[cite: 21]128+[cite: 21]
RecommendedNo[cite: 21]Yes[cite: 21]

Creating Partitions using fdisk

sudo fdisk /dev/sdb
CommandPurpose
nCreate partition[cite: 21]
dDelete partition[cite: 21]
pPrint partition table[cite: 21]
wWrite changes[cite: 21]
qQuit without saving[cite: 21]

⚠ Warning

Always verify the correct disk before writing partition changes[cite: 21].

Using parted

sudo parted /dev/sdb
print
mklabel gpt
mkpart primary ext4 1MiB 20GiB
quit

Creating Filesystems

ext4

mkfs.ext4 /dev/sdb1

XFS

mkfs.xfs /dev/sdb2

FAT32

mkfs.vfat /dev/sdb3

NTFS

mkfs.ntfs /dev/sdb4

Filesystem Comparison

FilesystemUsageJournaling
ext4General Linux[cite: 21]Yes[cite: 21]
XFSEnterprise[cite: 21]Yes[cite: 21]
BtrfsSnapshots[cite: 21]Yes[cite: 21]
FAT32USB[cite: 21]No[cite: 21]
NTFSWindows[cite: 21]Yes[cite: 21]

Understanding UUID

UUID uniquely identifies each filesystem and is preferred over device names[cite: 21].

blkid

🏢 Production Tip

Always use UUID entries in /etc/fstab[cite: 21].

What is Mounting?

Linux attaches every filesystem to a directory called a mount point[cite: 21].

🏢 Enterprise Insight

Large servers commonly use mount points like /u01, /backup, /data and /oracle[cite: 21].

Temporary Mount & Unmount

mount /dev/sdb1 /data
mount UUID=xxxxxxxx /data
umount /data

⚠ Important

A filesystem cannot be unmounted while it is in use[cite: 21].

/etc/fstab Configuration Table

The /etc/fstab file defines filesystems that should automatically mount during boot[cite: 21].

UUID=67bc1234-45ab /data ext4 defaults 0 2
FieldDescription
UUIDFilesystem identifier[cite: 21]
Mount PointDirectory[cite: 21]
Filesystemext4, xfs etc.[cite: 21]
OptionsMount options[cite: 21]
DumpBackup flag[cite: 21]
PassFilesystem check order[cite: 21]

Common Mount Options

OptionDescription
defaultsDefault options[cite: 21]
rwRead and write[cite: 21]
roRead only[cite: 21]
noexecDisable execution[cite: 21]
nosuidDisable SUID[cite: 21]
nodevIgnore device files[cite: 21]
noatimeImprove performance[cite: 21]

🏢 Production Tip

Always test /etc/fstab with mount -a before rebooting[cite: 21].

Disk Usage Commands

dfdu
Filesystem usage[cite: 21]Directory usage[cite: 21]
Total capacity[cite: 21]Folder/file size[cite: 21]

Repair ext4 & XFS Filesystems

Run repair utilities only on unmounted filesystems[cite: 21].

umount /dev/sdb1
fsck -f /dev/sdb1        # For ext4[cite: 21]
xfs_repair /dev/sdb2     # For XFS[cite: 21]

⚠ Warning

Never execute fsck on a mounted ext4 filesystem[cite: 21].

Swap Administration

Swap provides virtual memory when RAM becomes insufficient[cite: 21].

swapon --show
free -h
swapon /swapfile
swapoff /swapfile

Deleted but Open Files

A deleted file may still consume disk space if a running process keeps it open[cite: 21].

lsof | grep deleted

🏢 Production Tip

Restart the owning process after confirming the deleted file is no longer required[cite: 21].

Storage Performance Monitoring

ToolPurpose
iostatDisk I/O statistics[cite: 21]
iotopProcess disk usage[cite: 21]
sarHistorical performance[cite: 21]

Knowledge Check (MCQs)

  1. Which command repairs ext4? Answer: fsck[cite: 21]
  2. Which tool repairs XFS? Answer: xfs_repair[cite: 21]
  3. Which file stores persistent mounts? Answer: /etc/fstab[cite: 21]
  4. Which command shows filesystem usage? Answer: df -h[cite: 21]
  5. Which command shows directory size? Answer: du[cite: 21]
  6. Which command lists deleted open files? Answer: lsof[cite: 21]
  7. Which command enables swap? Answer: swapon[cite: 21]
  8. Which tool monitors disk I/O? Answer: iostat[cite: 21]
  9. Why use UUID? Answer: Stable device identification.[cite: 21]
  10. Should fsck run on mounted ext4? Answer: No.[cite: 21]

Commands Covered in This Chapter

  • lsblk - Display block device parameters[cite: 21]
  • blkid - Show UUID and filesystem type[cite: 21]
  • fdisk / gdisk / parted - Partition management tools[cite: 21]
  • mkfs - Build a system filesystem[cite: 21]
  • fsck / xfs_repair - Diagnose and fix filesystem corruption[cite: 21]
  • mount / umount - Control temporary directories mounts[cite: 21]
  • df / du / findmnt - Disk metrics monitoring systems[cite: 21]
  • swapon / swapoff - Virtual memory operations[cite: 21]
  • lsof - Locate open file allocations[cite: 21]
  • iostat / iotop / sar - Disk performance auditing suites[cite: 21]