Need help resizing VM disk

DavidSz

Member
May 9, 2020
12
0
6
26
Hi,

I know that there are a lot of topics of the same kind, but I can't seem to find the right solution for me..
Same as everyone else I resized the disk but did not thought it would do a +..G

So i'm trying to decrease the Hard Disk
1591886123851.png

Information:

I'm running a windows server 2012r2 vm, the extra storage hasn't been allocated yet (not sure if it needs to be or not to shrink)
1591886251363.png

If needed this is the output of pveversion https://pastebin.com/3vZWCUym

What I tried:

qemu-img resize --shrink vm-100-disk-0 300G
1591886401390.png

I wanted to try lvresize but I'm not sure if its a LVM

Can anyone help me to resize it with 300G without losing data?

Thnx!
David
 
No? From GUI you can only go up right? I wanna go down I want to "get rid of" 300G.
May you explain how to do it?

View attachment 17844
As far as I know, you cannot shrink disk size. You can only increase. The disk is already recongnised as 1300GB and you are trying to decrease it to 300GB, which will not work.

Eoin
 
As far as I know, you cannot shrink disk size. You can only increase. The disk is already recongnised as 1300GB and you are trying to decrease it to 300GB, which will not work.

Eoin

Hi, I'm trying to decrease it to 1000G, I'm not sure how to do it tho, with comment lines or GUI
 
Hi, I'm trying to decrease it to 1000G, I'm not sure how to do it tho, with comment lines or GUI
Hi,

I misunderstood, apologies. However, the size doesn't really matter anyway. My point was decreasing the disk size is not possible.

Eoin
 
@DavidSz You also have to find the actual disk file's location. The error message says that there's no file with the name you specified. Therefore, the file might be in a different directory.

Eoin
 
This is possible but does require messing about on the command line. What you will have to do is dd the old disk into a new disk copying only the first 1000G via a combination of blocksize= and count= arguments to dd. Then, with the VM offline, edit the config file to use the new disk. If it all works, you can delete the old disk.

Another way would be if you had a backup of the VM from before the size increase, You could restore that to give you the original disk size and then resize from there.
 

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!