How to Expand Your Linux Root Partition with LVM in Simple Steps
This guide walks you through checking disk usage, adding a new disk, creating a physical volume, extending the volume group and logical volume, and finally growing the XFS filesystem to successfully enlarge the Linux root partition.
Check current disk usage
Run df -hl to view existing partitions and free space.
List all disks
Execute fdisk -l to see all block devices.
Prepare the new disk
Partition the new disk with fdisk /dev/sdb. Follow the on‑screen prompts as shown.
Create a physical volume
Run pvcreate /dev/sdb1 to initialize the partition as a PV.
Verify the physical volume
Use pvdisplay to confirm the PV was created.
Add the PV to the volume group
Extend the existing VG (named centos) with vgextend centos /dev/sdb1.
Check free space in the VG
Run vgdisplay to view the free PE (Physical Extents) available.
Extend the root logical volume
Increase the size of the root LV with lvextend -L +60G /dev/mapper/centos-root.
Grow the XFS filesystem
Apply the new space to the filesystem using xfs_growfs /dev/mapper/centos-root.
Verify the expansion
Run df -hl again to see the increased size of the root partition.
The highlighted area in the final screenshot confirms that the root partition has been successfully expanded.
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.
Open Source Linux
Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.
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.
