Day 216 — Linux Storage Management: Ubuntu and Red Hat
2nd November, Netherlands — Storage management is an essential skill for Linux administrators, DevOps engineers, and Site Reliability Engineers (SREs). Whether you are configuring a new server, expanding storage, or troubleshooting disk issues, understanding Linux partitions is important.
In this blog, we will explore how to list, create, delete, and modify disk partitions in Ubuntu and Red Hat-based Linux distributions using practical commands.
Understanding Linux Disk Partitions
A physical disk can be divided into smaller logical sections called partitions. Each partition can contain a filesystem, swap space, or storage managed by LVM.
Common Linux disk naming conventions include:
/dev/sda— Physical disk/dev/sda1— First partition/dev/sda2— Second partition/dev/nvme0n1— NVMe disk/dev/nvme0n1p1— First NVMe partition
Ubuntu and Red Hat-based systems support tools such as lsblk, fdisk, parted, and blkid.
Listing Physical Disks and Partitions
Before modifying storage, identify available disks and their partitions.
lsblkDisplay disk sizes, filesystems, and mount points:
lsblk -f
sudo fdisk -l
sudo blkidTo check filesystem usage:
df -hTWhy? These commands help identify unused disks, existing partitions, and mounted filesystems.
Creating a New Partition
Suppose a new disk /dev/sdb is attached to your server.
Get Alok Rahul’s stories in your inbox
Join Medium for free to get updates from this writer.
Start the partitioning utility:
sudo fdisk /dev/sdbInside fdisk, use:
g Create a GPT partition table (new disk only)
n Create a new partition
p Print partition table
w Write changes to diskWarning: Creating a new partition table destroys the existing partition layout. Use g only when initializing a disk that contains no data you need.
Next, create an ext4 filesystem:
sudo mkfs.ext4 /dev/sdb1Mount the partition:
sudo mkdir -p /data
sudo mount /dev/sdb1 /dataFor persistent mounting, obtain the UUID using blkid and add the appropriate entry to /etc/fstab.
Deleting a Partition
To delete an existing partition:
sudo umount /dev/sdb1
sudo fdisk /dev/sdbInside fdisk:
p Display existing partitions
d Delete selected partition
w Save changesImportant: Back up critical data before deleting partitions. Removing a partition can make its data inaccessible.
Ubuntu vs. Red Hat: What Changes?
Conclusion
Linux partition management becomes straightforward once you understand the relationship between physical disks, partitions, filesystems, and mount points.
The essential commands are:
- List:
lsblk,fdisk -l - Create:
fdisk,mkfs - Delete:
fdisk - Modify:
parted,resize2fs,xfs_growfs
Always verify disk names, back up important data, and check whether filesystems are mounted before making changes.
Remember: A single incorrect disk command can cause permanent data loss. Practice using disposable disks or virtual machines before modifying production storage.









