Resize VM virtio disk - can't do it

pl11x

Active Member
Jun 2, 2018
20
2
43
39
Hi,

I'm in the middle of an issue which probably has a solution but my poor Linux knowledge seems to be a problem in these type of situations.

I've a VM with 20GB assigned space, using Debian 9.9.

1586456900029.png

I'd like to expand the space from 18.5G to ~100G. In Proxmox:

1586457091137.png

I don't need to reboot to see the upgrade reflected, as I am using virtio0 and 4.9 kernel version right now.

1586457369802.png

1586457422180.png

First of all, I'll try to create a new drive and assign it all the new space, using fdisk /dev/vda:

1586457819585.png

Here is the first problem. I can't create /dev/vda3 and assign all the space to them due to lost sectors between vda1 and vda2 (I don't know why). Ok, I did it and create /dev/vda4.

1586458149210.png

Now yes. It outputs an error when apply the changes, then I reboot as it says:

1586458252716.png

After reboot, there is no any new vda2 or vda4:

1586458491158.png

I don't know how to continue from this point. I tried different things (even this guide) but no luck.

Can I simply expand /dev/vda1? Everytime I try to do it, it says "device is busy" (is the boot drive so it's OK).

Could someone give me a tip about this?

Thanks!
 
You can't resize a partition mounted, and even unmounted, you need to destroy it and recreate it with new size, and same begin sector.

The more easy, is to not use partition at all. (format raw disks directly : /dev/vda , /dev/vdb, ... or use lvm logical volumes and format them directly)

Like this you can simply extend the filesystem (resize2fs , xfs_growfs, ...) after disk resize
 
  • Like
Reactions: pl11x
You can't resize a partition mounted, and even unmounted, you need to destroy it and recreate it with new size, and same begin sector.

The more easy, is to not use partition at all. (format raw disks directly : /dev/vda , /dev/vdb, ... or use lvm logical volumes and format them directly)

Like this you can simply extend the filesystem (resize2fs , xfs_growfs, ...) after disk resize

Hi,

Thank you for your answer. I didn't know the fact that I need to recreate the partition. Probably I'll change to lvm logical as soon as I fix a new problem regarding metadata due to snapshots :confused:. Creating a new thread right now...

Thank you again!
 

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!