Operations 5 min read

How to Expand a CentOS Data Disk Without Partitions Using resize2fs and xfs_growfs

This guide shows how to enlarge a CentOS 7.4 data disk that has no partitions—originally 5 GB and expanded to 10 GB—by resizing ext4 or XFS filesystems with resize2fs or xfs_growfs and verifying the new capacity with df.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
How to Expand a CentOS Data Disk Without Partitions Using resize2fs and xfs_growfs

When a data disk has no partitions and only a filesystem (or has been formatted directly), it can be mounted and used immediately.

In this example, a CentOS 7.4 64‑bit system has a data disk /dev/sdb of 5 GB with no partitions, only a filesystem. After expanding the disk size to 10 GB in the console, the following steps demonstrate how to extend the filesystem so the additional space becomes usable.

Extending an ext* filesystem

Run the resize command: resize2fs /dev/sdb

# resize2fs /dev/sdb
resize2fs 1.42.9 (28-Dec-2013)
Filesystem at /dev/sdb is mounted on /data; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 2
The filesystem on /dev/sdb is now 2621440 blocks long.

Verify the result: df -TH

# df -Th
Filesystem              Type      Size  Used Avail Use% Mounted on
device/tmpfs            devtmpfs  475M     0  475M   0% /dev
tmpfs                  tmpfs     487M     0  487M   0% /dev/shm
... (other mounts) ...
/dev/sdb                ext4      9.8G   23M  9.3G   1% /data

Extending an XFS filesystem

Run the XFS grow command: xfs_growfs /dev/vdb

# xfs_growfs /dev/vdb
meta-data=... (output omitted for brevity)
data blocks changed from 2621440 to 15728640.

Verify the result: df -TH

# df -TH
Filesystem     Type      Size  Used Avail Use% Mounted on
/dev/vdb       xfs        60G   34M   60G   1% /mnt/sdc

These commands allow the newly added disk space to be utilized without recreating partitions or reformatting.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxDisk ExpansionCentOSresize2fsxfs_growfs
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.