Thursday, February 19, 2026

Expand a VG (volume group) in Linux

 

If it's a VM, log onto the virtualization server and add a disk to the server

Log into the server as root. The items in red are what you will need for your environment. 

1) Run this command:

lsblk -fo name,fstype,mountpoint,size

2) Run this command to initialize the new storage as a PV:

pvcreate /dev/sdX

3) Run this command to identify the VG you want to extend:

vgs

4) Run this command to add the new PV to the VG:

vgextend <vg_name> /dev/sdX

5) Run this command to check the updated VG size:

vgdisplay <vg_name>

6) Run this command to identify the LV you want to extend:

lvs

7) Run this command to extend the LV using available space in the VG:

lvextend -L +100G /dev/<vg_name>/<lv_name>

(run this command with less free space than you added to prevent Linux from throwing a fit)

8) Run this command to rescan the drives:

for host in /sys/class/scsi_host/host*; do echo "- - -" | sudo tee $host/scan; done

 

I personally haven't had the below command work well for me. I usually do step 7 but you could try this instead. Once I figured out the commands needed, it takes me less that 10 minutes.

Run this command to extend to all free space in VG

Lvextend --size +100%FREE logical_volume

 

No comments:

Post a Comment

Introduction

Introduction

I've worked in IT for many years at this point. I thought I would share some of the things I had learned. When I went to review my note...