[SOLVED] [Help] Resize LVM

javito1081

New Member
Jan 4, 2024
19
4
3
Hi,

I just installed a new 1TB nvme disk on my proxmox server, replacing the original one i had which was 500gb, what i did was to clone the 500gb disk into the 1tb disk and i was up n runing in just minutes, but now i want to assign the free space left in the 1tb disk to the lvm-local partition.

Yes i know i can just do a fresh install of proxmox and id be done with it, but thats not what i want, i wanna know first if its possible to do the resizing which i asume it can be, i tried the regular tools to resize that come with debian but it doesnt work since its the boot disk, im guessing if this is possible i would have to boot from an external tool and do it on a temp eviroment?
 
The LVM can be extended during runtime:
  1. Create a new partition in the free space with fdisk /dev/sdX or cfdisk /dev/sdX The new partition is now /dev/sdXX as an example
  2. Create a new Physical Volume on the new partition with pvcreate /dev/sdXX
  3. Extend the volume group with vgextend pve /dev/sdXX
Now you can use the new free space to create new logical volumes or resize existing ones with lvresize

If you need more space for VM disks, extend the pve-data LV.
For example use the remaining space:
Bash:
lvextend -l +100%FREE /dev/mapper/pve-data
 
Last edited:
The LVM can be extended during runtime:
  1. Create a new partition in the free space with fdisk /dev/sdX or cfdisk /dev/sdX The new partition is now /dev/sdXX as an example
  2. Create a new Physical Volume on the new partition with pvcreate /dev/sdXX
  3. Extend the volume group with vgextend pve /dev/sdXX
Now you can use the new free space to create new logical volumes or resize existing ones with lvresize

If you need more space for VM disks, extend the pve-data LV.
For example use the remaining space:
Bash:
lvextend -l +100%FREE /dev/mapper/pve-data
My god man, that was quite simple, 0 hickups and worked like a charm, i did the resizing and then resized the partition size of my vm without any issues hehe, im still a bit confuse on how the whole LVM thing works tho, any place i can research about it? im intreague about the easyness of this system, compared to the windows one lol
 
  • Like
Reactions: Kingneutron
Hi,

I just installed a new 1TB nvme disk on my proxmox server, replacing the original one i had which was 500gb, what i did was to clone the 500gb disk into the 1tb disk and i was up n runing in just minutes, but now i want to assign the free space left in the 1tb disk to the lvm-local partition.

Yes i know i can just do a fresh install of proxmox and id be done with it, but thats not what i want, i wanna know first if its possible to do the resizing which i asume it can be, i tried the regular tools to resize that come with debian but it doesnt work since its the boot disk, im guessing if this is possible i would have to boot from an external tool and do it on a temp eviroment?
Hi Javito, how did you clone one nvme to the other? I may need to do a similar thing to yours, moving from 128g to 1tb, altough i have no replies yet in the thread :(, but if I have no better plan I'd do same as you.
 
Last edited:
My god man, that was quite simple, 0 hickups and worked like a charm, i did the resizing and then resized the partition size of my vm without any issues hehe, im still a bit confuse on how the whole LVM thing works tho, any place i can research about it? im intreague about the easyness of this system, compared to the windows one lol

Ha - if you think LVM is "easy" you should look into ZFS. Typically you give the whole disk (or an entire partition) to a pool, and then just create datasets. Typically you don't worry about resizing unless you're expanding the partition or replacing the disk with a larger one, and then there's very little messing about.

Commandline lvm is actually the hardest to work with as it's difficult to visualize what's going on.

If you want a more intuitive view of LVM, I'd start with standing up a SuSE VM and use ' yast ' as it makes LVM easier with a front-end. (You may have to ' zypper in yast2-* ' to get all the available yast modules.)

Then you can install ' webmin ' (runs on port 10000) - it also has a module for LVM that makes visualizing and manipulating your layout easier from the web browser.

Further reading:

https://www.linuxjournal.com/content/review-gui-lvm-tools
 
Ha - if you think LVM is "easy" you should look into ZFS. Typically you give the whole disk (or an entire partition) to a pool, and then just create datasets. Typically you don't worry about resizing unless you're expanding the partition or replacing the disk with a larger one, and then there's very little messing about.

Commandline lvm is actually the hardest to work with as it's difficult to visualize what's going on.

If you want a more intuitive view of LVM, I'd start with standing up a SuSE VM and use ' yast ' as it makes LVM easier with a front-end. (You may have to ' zypper in yast2-* ' to get all the available yast modules.)

Then you can install ' webmin ' (runs on port 10000) - it also has a module for LVM that makes visualizing and manipulating your layout easier from the web browser.

Further reading:

https://www.linuxjournal.com/content/review-gui-lvm-tools
Oh geez, aight ill definetly give it a loot hehe, tyvm for that :-)
 
  • Like
Reactions: Kingneutron

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!