[SOLVED] How to decrease disk VM (Windows)

Ivan Gersi

Renowned Member
May 29, 2016
83
7
73
54
There are several threads about not comfortable way how to shrink some VM (especially Win VM) with not clear results always.
This is my succesful way today.
I have 1TB VM Win2019 server but with only 90GB data in. I wanted to resize VM disk from 1TB to 500GB because there is waste time to backup or restore empty space.
Classic default Proxmox setup, local-lvm, VM with sata disk.
1st I tried to resize disk via lvreduce, then qm rescan.
But this way is wrong, VM cannot start correctly, automatic repair don`t fix the problem, maybe using cmd with bootrec can help...etc.
The right way is shrink disk in VM from 1000GB to 500GB in my case (465 in real for sure, because 500GB=465GB in win format). If you have a problem with shrink because not enough space, you have to turn off pagefile (12GB in my case, but remember i Have 880GB free space in Win!?), then restart, shrink some space, restart, shrink some space...I had to make 4 restarts from 100GB to 465GB...because Windows.
Then classic....lvm lvreduce -L - 500G disk and qm rescan...start the VM a server is running correctly again.

root@pve1:~# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
data pve twi-aotz-- 1.67t 5.54 0.35
root pve -wi-ao---- 96.00g
swap pve -wi-ao---- <7.53g
vm-100-disk-0 pve Vwi-aotz-- 500.00g data 18.95
 

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!