DEV Community

Amanda Igwe
Amanda Igwe

Posted on

Day 25/ 30 Days of Linux Mastery: Disk Management on RHEL 9

Table of Contents


Introduction

Welcome back to Day 25 of this practical Linux challenge!

Disk running out of space? Don't panic. Today, we dive into basic disk management using simple and practical Linux commands.

If you have ever seen the dreaded "disk full" error or wondered, "Where did all my space go?" then today’s lesson is for you.

As you grow in your journey as a Cloud System Admin or DevOps engineer, being able to know how to inspect, clean, and manage disk space becomes a **core skill.


What is Disk Management?

Disk space issues are one of the most common problems you will face in production environments. Whether it is logs filling up, unused packages, or large files forgotten, knowing how to find and fix space issues keeps your server healthy and running.

Managing disk space is crucial for:

  • Keeping your servers running smoothly
  • Avoiding outages due to full volumes
  • Debugging space-hungry apps
  • Mounting extra storage in cloud environments

Core Disk Management Commands

More commonly used Core Disk Management Commands options are listed in the table below.

Disk Management Command What it Does
df -h Shows available disk space (human-readable)
du -sh * Shows folder sizes in current directory
lsblk Lists block devices like disks and partitions
mount Mounts a filesystem
umount Unmounts a mounted filesystem
journalctl --disk-usage Check journal log size
journalctl --vacuum-size=100M Clear logs down to a specific size
rm -rf <path> Remove unwanted files/directories (use with caution)
blkid Shows UUID and type of a block device

Real-World Scenario: Disk Management Commands

You are running a small RHEL 9 web server, and suddenly you get an alert:

Disk usage at 90%. Clean up space immediately.

Let’s walk through what to do:

  • First Check Disk Usage.
df -h 
Enter fullscreen mode Exit fullscreen mode

dc1 description

  • Now check what's using the disk space
du -sh /*    - # you can do this only using root, add sudo before the command if you are not
Enter fullscreen mode Exit fullscreen mode

dc2 description

  • Now you have seen what's eating your space you can open that folder
du -sh /var/*
Enter fullscreen mode Exit fullscreen mode

dc3 description

  • You can go ahead to delete
rm -rf <directory path>

# or clear caches using 

dnf clean all

Enter fullscreen mode Exit fullscreen mode

dc4 description


Conclusion

Disk management is not just for advanced users; even as a beginner on RHEL 9, you can confidently check, manage, and free up space on your system. These small actions make a huge difference in production environments.

If this is helpful to you, feel free to bookmark, comment, like and follow me for Day 26!


Let's Connect!

If you want to connect or share your journey, feel free to reach out on LinkedIn.
I am always happy to learn and build with others in the tech space.

#30DaysLinuxChallenge #Redhat#RHCSA #RHCE #CloudWhistler #Linux #Rhel #Ansible #Vim #CloudComputing #DevOps #LinuxAutomation #IaC #SysAdmin#CloudEngineer

Top comments (0)