Operations 3 min read

Step-by-Step Guide to Expanding Linux Root Partition with LVM

This tutorial walks you through checking disk usage, adding a new disk, creating a physical volume, extending the volume group and logical volume, and finally resizing the XFS filesystem on a CentOS system to successfully enlarge the root partition.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Step-by-Step Guide to Expanding Linux Root Partition with LVM

Before expanding the root filesystem, check current disk usage and existing partitions.

df -hl
fdisk -l

Identify the new disk (e.g., /dev/sdb) and create a partition on it.

fdisk /dev/sdb

Create a physical volume on the new partition. pvcreate /dev/sdb1 Verify the physical volume.

pvdisplay

Extend the existing volume group (named centos) to include the new physical volume. vgextend centos /dev/sdb1 Check the free space in the volume group.

vgdisplay

Increase the size of the logical volume that holds the root filesystem.

lvextend -L +60G /dev/mapper/centos-root

Resize the XFS filesystem to use the added space.

xfs_growfs /dev/mapper/centos-root

Finally, confirm that the root partition has grown.

df -hl
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.

LVMCentOSdisk-managementRoot Expansion
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.