How to Expand an Unpartitioned Data Disk on CentOS 7.4 Without Reboot
This guide demonstrates how to enlarge a CentOS 7.4 data disk that has only a filesystem (no partitions) after increasing its size in the cloud console, using resize2fs for ext* filesystems and xfs_growfs for XFS, with verification commands.
The article uses a CentOS 7.4 64‑bit example where the data disk /dev/sdb originally has 5 GB, no partitions, and only a filesystem. After expanding the disk to 10 GB in the cloud console, the guide shows how to make the additional space usable.
Ext* filesystem expansion
Run the resize2fs command on the device to grow the filesystem.
# 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 new size with df -TH .
# df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/centos-root xfs 17G 1.7G 16G 10% /
/dev/sda1 xfs 1014M 138M 877M 14% /boot
/dev/sdb ext4 9.8G 23M 9.3G 1% /dataXFS filesystem expansion
Run xfs_growfs on the XFS device.
# xfs_growfs /dev/vdb
meta-data=data=/dev/vdb isize=512 agcount=4, agsize=655360 blks
... (truncated output) ...
data blocks changed from 2621440 to 15728640.Check the expanded size with df -TH .
# df -TH
Filesystem Type Size Used Avail Use% Mounted on
/dev/vdb xfs 60G 34M 60G 1% /mnt/sdcBefore and after the operations, lsblk can be used to view the disk layout and confirm that the device now shows the increased size (e.g., sdb 10G instead of 5G).
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
