Operations 5 min read

How to Expand an XFS Root Partition on Linux Without LVM

This guide walks you through checking the current XFS root size, enlarging the virtual disk in VMware, installing the growpart utility, extending the root partition, resizing the XFS filesystem with xfs_growfs, and verifying the new 40 GB capacity, while noting important constraints such as the need for no following partitions.

Liangxu Linux
Liangxu Linux
Liangxu Linux
How to Expand an XFS Root Partition on Linux Without LVM

Check current root partition size

Run df -Th / to view the root filesystem size (e.g., 17 GB). Verify the underlying disk with lsblk and fdisk -l.

[root@localhost ~]# df -Th /
Filesystem     Type  Size  Used Avail Use% Mounted on
/dev/nvme0n1p2 xfs   17G   1.6G  16G   10% /

Resize the virtual disk

In VMware Workstation shut down the VM and increase the virtual disk from 20 GB to 40 GB. The screenshots below illustrate the disk before and after the change.

VMware disk size before expansion
VMware disk size before expansion
VMware disk size after expansion
VMware disk size after expansion

Install the growpart utility

Install the required tools with:

[root@localhost ~]# yum -y install cloud-utils-growpart gdisk

Extend the root partition

Use growpart to enlarge the second partition (the root) on /dev/nvme0n1:

[root@localhost ~]# growpart /dev/nvme0n1 2
CHANGED: partition=2 start=1026048 old: size=35651584 end=36677632 new: size=82859999 end=83886047

Resize the XFS filesystem

If df -Th still reports the old size, run xfs_growfs / to expand the filesystem:

[root@localhost ~]# xfs_growfs /
meta-data=/dev/nvme0n1p2 isize=512 agcount=4 agsize=1114112 blks
... (output truncated) ...
data blocks changed from 4456448 to 10357499

Verify the expansion

Check the final size with:

[root@localhost ~]# df -hT /
Filesystem     Type  Size  Used Avail Use% Mounted on
/dev/nvme0n1p2 xfs   40G   1.8G  38G   5% /

Important notes

The growpart command can only extend a partition when no other partitions follow it; otherwise it fails. If a swap partition exists after the root, delete or move the swap before using growpart. After extending the partition, always verify with df -Th and, if necessary, run xfs_growfs to complete the filesystem resize.

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 ExpansionXFSxfs_growfsRoot Partitiongrowpart
Liangxu Linux
Written by

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.)

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.