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