How to live-resize guest (non-root) drive?

nicorac

Member
Apr 28, 2011
12
1
23
Hello everyone,
I'm setting up a Linux File Server VM with ProxmoxVE.

Since Samba doesn't allow to set up quota for a share, my VM config is like the following.
Everything is (obviously) over LVM on the host.

root disk (will never change it)
Code:
virtio0: /dev/mapper/vm_root
and one (or more) additional drives, one for each share:
Code:
virtio1: /dev/mapper/vm_share1
virtio2: /dev/mapper/vm_share2
...
Well, it works well because users accessing \\srv\share1 are limited by the partition size itself.

Here comes the question: suppose vm_share1 was 10Gb and now I need it to grow to 20Gb.
I'll grow it with LVM and lvdisplay on the host confirms the new size.

Is there a way to tell the guest that now virtio1: is 20Gb without rebooting it?
I tried partprobe on the host with no success; I also tried to unbind the pci device (on the host) with
Code:
echo "0000:xx:xx.x" > /sys/bus/pci/drivers/virt_io/unbind
and bind it back again, no success.

I think that I should tell KVM to re-read this device properties, but I don't know how.

Can someone shed some light on it?
Thanks in advance.
 

nicorac

Member
Apr 28, 2011
12
1
23
You're right, I could define a single 100Gb disk on the host and attach it to the guest and manage it with LVM.
But I'd like to avoid the double LVM layer, one on the host and another one inside the guest.

That's why I defined my share disks in the host, then I attached all of them to the guest.

I'd like to resize them without rebooting; obviously I could accept a break on the single share I'm growing.
 

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 your own in 60 seconds.

Buy now!