DEV Community

Cover image for Disk Usage and Storage Monitoring in Red Hat Linux
shamain anjum
shamain anjum

Posted on

Disk Usage and Storage Monitoring in Red Hat Linux

Welcome to Day 8 of the 30 Days of Linux Challenge. Starting today, we’re using Red Hat Linux (RHEL-based environments) for all remaining sessions.

Today’s focus is one of the most crucial responsibilities of a Linux administrator: monitoring disk space and managing storage. Whether you’re running a web server, managing logs, or planning a backup routine — visibility into your system’s storage is key to keeping things running.

📚 Table of Contents

Why Disk Management Matters

Disk space issues are among the top causes of system outages. In Red Hat Linux environments, this can result in:

  • Services failing to start
  • Logs not being written
  • Software updates breaking
  • Backups silently failing

Learning to monitor, analyze, and clean up your disks is a core competency for system administrators.

Essential Disk Commands on RHEL

Here are key tools and commands built into Red Hat-based systems:

📦 df – Disk Usage Overview

df -h
Shows used and available space on all mounted filesystems

-h gives human-readable sizes

Image description

📁 du – Directory Space Usage

du -sh /var/log
View how much space a directory is using

Image description

Add -a to include files, -x to stay on one filesystem

💽 lsblk – View Block Devices
lsblk
Lists physical storage devices and their partitions/mount points

Image description

🔗 mount or findmnt – See Mounted Filesystems

mount | grep '^/dev'
findmnt

Image description

🔍 blkid – Show UUIDs and Filesystem Info
sudo blkid

Image description

Understanding Filesystems in Red Hat

Red Hat commonly uses:

  • XFS (default on RHEL 7+)
  • ext4
  • LVM for dynamic partitioning

To check filesystem type:

df -T

Monitoring and Cleaning Disk Usage

*Find large files and directories:
*

du -ahx / | sort -rh | head -20
du -sh /var/log/*

Find files over 500MB:

find / -type f -size +500M -exec ls -lh {} \; | sort -k 5 -rh | head -10

*Clean Up Space:
*
🧹 Clear journal logs (default in RHEL):

sudo journalctl --vacuum-time=7d

🧹 Clear DNF/YUM cache:
sudo dnf clean all

🧹 Remove orphaned packages:
sudo dnf autoremove

LVM: Logical Volume Management

Many Red Hat systems use LVM by default. LVM allows you to resize partitions, create snapshots, and manage disks more flexibly.

View LVM status:

sudo vgs # Volume Groups
sudo lvs # Logical Volumes
sudo pvs # Physical Volumes
We’ll dive deeper into LVM configuration and resizing later in the challenge.

Try It Yourself

Open your Red Hat terminal and try:

  1. df -h
  2. du -sh /home/*
  3. lsblk
  4. sudo dnf clean all
  5. sudo journalctl --vacuum-time=7d
  6. sudo vgs

This will give you a full picture of your system’s current disk health.

Why This Matters

Without proper storage monitoring:

  • Services fail unexpectedly
  • Updates won’t apply
  • You risk data loss or system crashes
  • These tools are essential for troubleshooting, capacity planning, and ensuring reliability in production.

Top comments (0)