Operations 5 min read

How to Extend a Linux Disk with LVM Without Reboot

This guide walks through a real‑world case where a virtual machine shows only ~30 GB free while a hidden 160 GB disk is detected, and demonstrates step‑by‑step how to use LVM to add, partition, and resize the disk without restarting the system.

ITPUB
ITPUB
ITPUB
How to Extend a Linux Disk with LVM Without Reboot

In a recent scenario a virtual machine displayed only about 30 GB of free space with df -h, while fdisk -l revealed an unused 160 GB disk that needed to be mounted without rebooting.

The solution relies on Logical Volume Manager (LVM), which provides flexible creation, resizing, and management of logical volumes on top of physical volumes without requiring a system restart.

LVM Overview

LVM uses a three‑layer hierarchy: physical disks are partitioned into Physical Volumes (PV), one or more PVs form a Volume Group (VG), and VGs can host multiple Logical Volumes (LV). Filesystems are created on LVs and can be mounted like regular partitions.

Step‑by‑step Disk Expansion

Check current free space

df -h

Identify the unmounted 160 GB disk

fdisk -l

Create a new partition of type 8e (LVM)

fdisk /dev/sdb

Initialize the partition as a Physical Volume

pvcreate /dev/sdb

Verify the PV creation

pvdisplay

Extend the existing Volume Group (centos) with the new PV

vgextend centos /dev/sdb

Display the VG status

vgdisplay

Resize the logical volume to use all free space

lvextend -l +100%FREE /dev/mapper/centos-root

Grow the XFS filesystem to occupy the enlarged LV

xfs_growfs /dev/mapper/centos-root

Confirm the new capacity

df -h

After these commands the root filesystem expands from about 35 GB to roughly 185 GB, all without rebooting the server.

Reference URLs: https://linux.cn/articles/3218-1.html https://www.cnblogs.com/kevingrace/p/5825963.html

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.

LinuxLVMDisk ExpansionFilesystem
ITPUB
Written by

ITPUB

Official ITPUB account sharing technical insights, community news, and exciting events.

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.