KVM: Shrink Disk

nightshift

Renowned Member
May 9, 2013
4
0
66
Hello,

i have a running kvm virtual machine with proxmox 3. its running qcow2 and there is an 100 GB sized Windows 2012 installation inside.

i wanted to resize the disk and used "Resize Disk" inside Proxmox.

the size should be 120 GB but i made mistakes and now i habe 670 GB.

how can i set it to 120 GB without loosing data inside the vm?
 
Hello,

i have a running kvm virtual machine with proxmox 3. its running qcow2 and there is an 100 GB sized Windows 2012 installation inside.

i wanted to resize the disk and used "Resize Disk" inside Proxmox.

the size should be 120 GB but i made mistakes and now i habe 670 GB.

how can i set it to 120 GB without loosing data inside the vm?


you can try with qemu monitor with command:

example to remove 100GB from drive virtio0

"block_resize drive-virtio0 -100G"
 
The correct command is "block_resize drive-virtio0 120G" to set the size of the complete disk to 120GB.

block_resize doesn't handle negative values, at least not in Proxmox 3.1
 

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!