[SOLVED] Resize Ubuntu VM disk

Sikjairi

Active Member
Jan 7, 2020
32
39
38
36
Africa
Hi Guys,
I would like to increase the size of my VM 20go more to achieve the total of 52go ,how can i deal with it ? ,
there's my configs screens : Thank you in advance .

1668113831285.png
1668113858329.png
1668113892465.png
 
  • Like
Reactions: ardiankaryp
These are the keywords for google: "lvm size increase"
An example suitable search result: https://www.redhat.com/sysadmin/resize-lvm-simple


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
Thanks for your reply , my problem solved here's how :

1st step: increase/resize disque from GUI console 2nd step : Extend physical drive partition check free space : $sudo fdisk -l $growpart /dev/sda 3 (Extend physical drive partition ) $pvdisplay ( See phisical drive ) $sudo pvresize /dev/sda3 (Instruct LVM that disk size has changed) $ pvdisplay ( check physical drive if has changed ) [U]3rd step: Extend Logical volume [/U] $ lvdisplay (# View starting LV) $ sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv ( # Resize LV) $ lvdisplay (# View changed LV) 4th step : Resize Filesystem $ resize2fs /dev/ubuntu-vg/ubuntu-lv $ fdisk -l (# Confirm results)
 
Thanks for your reply , my problem solved here's how :

1st step: increase/resize disque from GUI console 2nd step : Extend physical drive partition check free space : $sudo fdisk -l $growpart /dev/sda 3 (Extend physical drive partition ) $pvdisplay ( See phisical drive ) $sudo pvresize /dev/sda3 (Instruct LVM that disk size has changed) $ pvdisplay ( check physical drive if has changed ) [U]3rd step: Extend Logical volume [/U] $ lvdisplay (# View starting LV) $ sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv ( # Resize LV) $ lvdisplay (# View changed LV) 4th step : Resize Filesystem $ resize2fs /dev/ubuntu-vg/ubuntu-lv $ fdisk -l (# Confirm results)
Helped me ALOT, thank you. Could not finde the right thing through googling ... :D
 
Thanks for your reply , my problem solved here's how :

1st step: increase/resize disque from GUI console 2nd step : Extend physical drive partition check free space : $sudo fdisk -l $growpart /dev/sda 3 (Extend physical drive partition ) $pvdisplay ( See phisical drive ) $sudo pvresize /dev/sda3 (Instruct LVM that disk size has changed) $ pvdisplay ( check physical drive if has changed ) [U]3rd step: Extend Logical volume [/U] $ lvdisplay (# View starting LV) $ sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv ( # Resize LV) $ lvdisplay (# View changed LV) 4th step : Resize Filesystem $ resize2fs /dev/ubuntu-vg/ubuntu-lv $ fdisk -l (# Confirm results)
I don't see a way to do step 1. In the Proxmox gui for the VM there is no place to increase the size that I can find.
 
Thanks for your reply , my problem solved here's how :

1st step: increase/resize disque from GUI console 2nd step : Extend physical drive partition check free space : $sudo fdisk -l $growpart /dev/sda 3 (Extend physical drive partition ) $pvdisplay ( See phisical drive ) $sudo pvresize /dev/sda3 (Instruct LVM that disk size has changed) $ pvdisplay ( check physical drive if has changed ) [U]3rd step: Extend Logical volume [/U] $ lvdisplay (# View starting LV) $ sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv ( # Resize LV) $ lvdisplay (# View changed LV) 4th step : Resize Filesystem $ resize2fs /dev/ubuntu-vg/ubuntu-lv $ fdisk -l (# Confirm results)
Helped me ALOT, thank you. Could not finde the right thing through googling ... :D (2)
 
Thanks for your reply , my problem solved here's how :

1st step: increase/resize disque from GUI console 2nd step : Extend physical drive partition check free space : $sudo fdisk -l $growpart /dev/sda 3 (Extend physical drive partition ) $pvdisplay ( See phisical drive ) $sudo pvresize /dev/sda3 (Instruct LVM that disk size has changed) $ pvdisplay ( check physical drive if has changed ) [U]3rd step: Extend Logical volume [/U] $ lvdisplay (# View starting LV) $ sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv ( # Resize LV) $ lvdisplay (# View changed LV) 4th step : Resize Filesystem $ resize2fs /dev/ubuntu-vg/ubuntu-lv $ fdisk -l (# Confirm results)
This is very helpful. Thanks!
 
These are the keywords for google: "lvm size increase"
An example suitable search result: https://www.redhat.com/sysadmin/resize-lvm-simple


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
I really have to say that this response was so RTFM/STFU to the OP that I'm having a hard time seeing how you have a "Famous Member" title. I literally had to create an account to respond to this because it's so monumentally unhelpful. I mean, the second link on Google today was EXACTLY the same procedure that OP ended up using. Hell, even a proxmox forum post from May 2020 had better info: https://forum.proxmox.com/threads/resize-disk-of-ubuntu-19-10-vm-on-proxmox.70352/

People with knowledge need to do better to help out those who haven't done the work themselves yet. Read the whole question and give the proper answer, even if you have to go use https://letmegooglethat.com/ and be snarky, at least the info would be contextually appropriate and pertinent.

Found yet another source, this time straight from Proxmox documentation: https://pve.proxmox.com/wiki/Resize_disks
 
Last edited:
Hi there,
@Kapsville This procedure will affect my data? Is it ok if my disk is almost full ?
I've done this countless times on disks that are full with no issues. That said it's still a risk to resizefs, however since the tool should only function against the blank part of the disk you should be fine. Just go slow and check your work as you go. You'll be just fine.
 
Thnx a lot for the prompt response. I would be much obliged if you could give one more hint.
As you can see in the screenshot the VM machine does not manage disks with LVM
I relasied this later since I haven't install this VM.
These commands were given against VM ( Ubuntu 22.04.2 LTS)
CGEi8Y0.png

In the proxmox machine the LVM is used to mabage the disks.
How can I increase the VM (gpu-host) disk to 400GB (from 223 GB) ?
BoJB5RV.png

U09vryb.png


xCv7wBA.png

Thank you for you concern

Regards
/Dimitris
 
Last edited:
Hey Dimitirs! You're logged into the wrong place.

You should ssh or console into your vm's shell, but you're looking at the vm hosts cli.

It looks like "morpheus" is your host server. SSH into vm 100 and you should be fine.
 
As you can see in the screenshot the VM machine does not manage disks with LVM
You are correct, the VM structure is Raw Disk>Partition>Filesystem.

As you correctly highlighted the Raw Disk (virtual disk provided by PVE/Qemu) has already been expanded. Your screenshot shows 406G capacity, of which 256G is partitioned.

You can, in fact, use the above referenced link keeping in mind that only some commands are applicable. Specifically you need to extend the partition 2 size (sda2) and then simply resize the filesystem (last step).

Some additional helpful search words: "linux resize partition", https://www.msp360.com/resources/blog/linux-resize-partition/

Good luck


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
Hi and thnx again for the REALLY fast response. I ssh-ed to both machine to give you the big picture. I will act carefully after I save a snapshot!. Is it possible to convert the raw disk to LVM (without loasing data )?
 
Thanks for your reply , my problem solved here's how :

1st step: increase/resize disque from GUI console 2nd step : Extend physical drive partition check free space : $sudo fdisk -l $growpart /dev/sda 3 (Extend physical drive partition ) $pvdisplay ( See phisical drive ) $sudo pvresize /dev/sda3 (Instruct LVM that disk size has changed) $ pvdisplay ( check physical drive if has changed ) [U]3rd step: Extend Logical volume [/U] $ lvdisplay (# View starting LV) $ sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv ( # Resize LV) $ lvdisplay (# View changed LV) 4th step : Resize Filesystem $ resize2fs /dev/ubuntu-vg/ubuntu-lv $ fdisk -l (# Confirm results)

Thx a lot, but i'm not understand how it's work? Solved
 
Thanks for your reply , my problem solved here's how :



1st step: increase/resize disque from GUI console
2nd step : Extend physical drive partition
check free space : $sudo fdisk -l
$growpart /dev/sda 3 (Extend physical drive partition )
$pvdisplay ( See phisical drive )
$sudo pvresize /dev/sda3 (Instruct LVM that disk size has changed)
$ pvdisplay ( check physical drive if has changed )



[U]3rd step: Extend Logical volume [/U]
$ lvdisplay (# View starting LV)
$ sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv ( # Resize LV)
$ lvdisplay (# View changed LV)


4th step : Resize Filesystem
$ resize2fs /dev/ubuntu-vg/ubuntu-lv
$ fdisk -l (# Confirm results)
rrofsh !
 

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!