Operations 4 min read

How to Expand the Root Partition on CentOS 7 Using LVM in Simple Steps

This step‑by‑step guide shows how to check current disk usage, add a 60 GB disk, create a physical volume, extend the volume group and logical volume, resize the filesystem, and verify the root partition expansion on a CentOS 7 server.

Open Source Linux
Open Source Linux
Open Source Linux
How to Expand the Root Partition on CentOS 7 Using LVM in Simple Steps

Introduction

Linux servers often run out of disk space on the root partition. This guide demonstrates how to extend the root logical volume on a CentOS 7 system using LVM.

Step‑by‑Step Expansion

1. Check current disk usage

Use df -h to view the current usage; the root partition shows about 29 GB free.

2. Simulate a full root partition

Create a 29 GB file with dd to fill the root partition.

3. Add a new 60 GB disk

Physically attach a 60 GB disk to the server.

4. Identify the new disk

Use fdisk -l (or similar) to find the device name, e.g., /dev/xvdf.

5. Create a Physical Volume (PV)

Initialize the new disk as a PV without partitioning: pvcreate /dev/xvdf.

6. Extend the Volume Group (VG)

Find the VG that contains the root LV with lvs (e.g., centos) and add the new PV: vgextend centos /dev/xvdf. The VG now shows about 60 GB free.

7. Extend the root logical volume

Increase lv_root by 60 GB: lvextend -L +60G /dev/centos/root (or lvextend -l +100%FREE /dev/centos/root).

8. Resize the filesystem

Refresh the filesystem to use the new space, e.g., resize2fs /dev/centos/root for ext4 or xfs_growfs / for XFS.

9. Verify the expansion

Run df -Th to confirm the root partition now reflects the increased capacity.

After these steps the root partition is successfully expanded, allowing more storage for your Linux server.

LinuxLVMDisk ExpansionCentOS7Root Partition
Open Source Linux
Written by

Open Source Linux

Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.

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.