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.
Before expanding the root filesystem, check current disk usage and existing partitions.
df -hlfdisk -lIdentify the new disk (e.g., /dev/sdb) and create a partition on it.
fdisk /dev/sdbCreate a physical volume on the new partition. pvcreate /dev/sdb1 Verify the physical volume.
pvdisplayExtend the existing volume group (named centos) to include the new physical volume. vgextend centos /dev/sdb1 Check the free space in the volume group.
vgdisplayIncrease the size of the logical volume that holds the root filesystem.
lvextend -L +60G /dev/mapper/centos-rootResize the XFS filesystem to use the added space.
xfs_growfs /dev/mapper/centos-rootFinally, confirm that the root partition has grown.
df -hlSigned-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.
