Extend LVM partition with VMs running

picklerick

New Member
Feb 4, 2020
2
0
1
33
Hi

Sorry if this has already been answered - I've searched and I only see articles about guest LVM partitions.

We're running:

Code:
proxmox-ve: 6.0-2 (running kernel: 5.0.15-1-pv
pve-manager: 6.0-4 (running version: 6.0-4/2a71925
pve-kernel-5.0: 6.0
pve-kernel-helper: 6.0
pve-kernel-5.0.15-1-pve: 5.0.15-1

It's a Dell server with a PERC H730P RAID card. It supports adding additional drives to the RAID10 virtual disk. We had 4 and just added 2 more, to increase the space available for new VMSs from 2TB to 3TB.

After running
Code:
echo 1 > /sys/block/sda/device/rescan
, I see:
Code:
Disk /dev/sda: 2.7 TiB, 2998960914432 bytes, 5857345536 sectors
Disk model: PERC H730P Adp  
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 4D1676FA-623A-42A7-B353-DEA90A45C243

Device       Start        End    Sectors  Size Type
/dev/sda1       34       2047       2014 1007K BIOS boot
/dev/sda2     2048    1050623    1048576  512M EFI System
/dev/sda3  1050624 3904896990 3903846367  1.8T Linux LVM
on the host.

Now I want to extend /dev/sda3, the LVM partition that has a logical volume for each of the VMs. We're using LVM thin provisioning.

Is it safe to go ahead and extend that partition with parted, and then expand the volume group with vgextend, with all of our VMs running?

Or is there a safer way to extend the space available? Or does it have to be done with the VMs stopped?
 
Is it safe to go ahead and extend that partition with parted, and then expand the volume group with vgextend, with all of our VMs running?

Or is there a safer way to extend the space available? Or does it have to be done with the VMs stopped?
Using parted, pvresize and lvresize is always a risk, since you change the layout of your storage. Best have a backup, just in case. ;) But it should be doable with running VM/CTs.
https://pve.proxmox.com/wiki/Resize_disks#Online_for_Linux_guests_with_LVM
 
Thanks @Alwin and @ezequielszurita but it seems like both of your comments relate to resizing a guest LV, I was talking about the host PV.

I ended up using parted to create a new PV and then ran vgextend to add the second PV to the VG.

Luckily I found this article before I did:
https://pve.proxmox.com/wiki/LVM2#Resize_metadata_pool

but it seems that (luckily) my LVM thin partition already had 16GB metadata, good for a thin partition up to 16TB. I also checked the metadata used % which was only at 3%.

This seemed safer than modifying the existing PV and it went without a hitch.
 
Thanks @Alwin and @ezequielszurita but it seems like both of your comments relate to resizing a guest LV, I was talking about the host PV.
Same thing.

I ended up using parted to create a new PV and then ran vgextend to add the second PV to the VG.
Writes will now be split between the two PVs. This means, that any LV will span both PVs.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!