Grow a lvm partition

ixproxmox

Renowned Member
Nov 25, 2015
77
5
73
I have been really struggling with this and I don't know why. I have a lvm-partition /dev/sda3 that I use for storing the vm-machines and want to increase it due to expanded underlying disk.

I have added on disk to the system and expanded the disk from 3.49TB to 4.4TB and as you see, fdisk report the same.

I want this lvm partition (/dev/sda3) to grow to fill the disk. I'm able to create a new sda4 partition and create a lvm-group on that and I can of course create a lvm on top. But I really would like to just lvmgrow somehow. The /dev/sda3 should be increased to max. Why is it so difficult?

I have a hw raid array /dev/sda:

Disk /dev/sda: 4.4 TiB, 4798283776000 bytes, 9371648000 sectors
Disk model: MR9361-8i
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 1048576 bytes
Disklabel type: gpt
Disk identifier: 3377A156-57E0-4428-9079-3D86964DF8B6

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 7497318400 7496267777 3.5T Linux LVM

Partition 1 does not start on physical sector boundary.

Command (m for help): q

xfs_growfs: /dev/sda3 is not a mounted XFS filesystem
root@px1:~# xfs_growfs /dev/sda3

root@px1:~# vgs
VG #PV #LV #SN Attr VSize VFree
local-extra 1 0 0 wz--n- <953.87g <953.87g
local-extra-lvm 1 1 0 wz--n- <2.73t 0
pve 1 21 0 wz--n- 3.49t 0
root@px1:~# pvs
PV VG Fmt Attr PSize PFree
/dev/sda3 pve lvm2 a-- 3.49t 0
/dev/sdb local-extra lvm2 a-- <953.87g <953.87g
/dev/sdc local-extra-lvm lvm2 a-- <2.73t 0
root@px1:~#

/sdb and /sdc is just some additional disks on the system not in real use.

oot@px1:~# pvdisplay
--- Physical volume ---
PV Name /dev/sdc
VG Name local-extra-lvm
PV Size <2.73 TiB / not usable 4.46 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 715396
Free PE 0
Allocated PE 715396
PV UUID jPYj99-GZnE-3f9X-Ylql-qYSn-stwc-vZMAZV

--- Physical volume ---
PV Name /dev/sdb
VG Name local-extra
PV Size <953.87 GiB / not usable <2.34 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 244190
Free PE 244190
Allocated PE 0
PV UUID 58OGnp-7ifm-pw7A-IWgp-fCwz-C0Pd-2GMu6d

--- Physical volume ---
PV Name /dev/sda3
VG Name pve
PV Size 3.49 TiB / not usable 2.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 915071
Free PE 0
Allocated PE 915071
PV UUID 1F7LK0-DF3K-CQYX-MW3F-1Lqk-RbUx-oZgUWb

root@px1:~#
 
Thanks, it looks like something I manage before, but shows two different paritions. But if I can pull ut off, maybe it can work..

root@px1:~# vgextend pve /dev/sda4
Volume group "pve" successfully extended

The volume group pve contains now to partitions.

When going into thinpool based on this volume group, it still shows 3.4TB. Is there a similar command for thinpool? It looks like the volumegroup pve now has free space as it should:

root@px1:~# vgs
VG #PV #LV #SN Attr VSize VFree
pve 2 21 0 wz--n- 4.36t <893.75g

root@px1:~# pvs
PV VG Fmt Attr PSize PFree
/dev/sda3 pve lvm2 a-- 3.49t 0
/dev/sda4 pve lvm2 a-- <893.75g <893.75g


--- Physical volume ---
PV Name /dev/sda3
VG Name pve
PV Size 3.49 TiB / not usable 2.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 915071
Free PE 0
Allocated PE 915071
PV UUID 1F7LK0-DF3K-CQYX-MW3F-1Lqk-RbUx-oZgUWb

--- Physical volume ---
PV Name /dev/sda4
VG Name pve
PV Size <893.75 GiB / not usable 2.98 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 228799
Free PE 228799
Allocated PE 0
PV UUID IrauV8-ozgw-SyrM-4FYA-7LCJ-Muh5-chzwSK
 

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!