raw Shrink Disk

NetRock

Renowned Member
Apr 23, 2015
78
1
71
Hi ...
With version 5.2 how can I shrink a KVM raw disk size:
'qm resize' is not supported to shrink,
'qemu-img resize -f raw /var/lib/vz/images/103/vm-103-disk-1.raw 500G' is not working also.

Thank you for your help.
 
Hi,

It's not so easy...

You first need to reduce the file system size and the partition size inside the guest, only then you can shrink it, then you additonally need to tell qemu-img that you know what you do, and that dta loss is expected if you did not reduced the guests FS/Parition boundaries with the qemu-img '--shrink' option.

I really recommend that you test this procedure on a test VM with unimportant data, else you may have a bad time...
 
hello, I tried to reduce the image but tells me that it does not find the file I have the directories, even if the path is correct, I would need to resize these raw images, you did it?
thank you
 

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!