virtual machine hd size

rafafell

Well-Known Member
Sep 24, 2016
61
2
48
37
Hi,

When I delete HD data from the virtual machine, the raw/qcow2 file does not reduce, correct? Is there any way you can do this?

For example,
(1) I created the virtual machine and put a HD 500 GB, the qcow2 file appeared with 50 MB - OK
(2) then I put 100 GB (data) and the qcow2 file appeared with 100 GB - OK
(3) then I deleted the 100 GB, but the qcow2 file kept the size of 100 GB - (??)

(??) - Is there any way to get back to seeing the 50 MB and keeping the HD limit at 500 GB?
 
How do I leave default by linux: When deleting files or directories to zero out your disk for any user?

If multiple users put and delete files in different places it will be difficult to use dd and rm



Thanks!
 
You need to mount the disk in Linux with discard, this can be set in the fstab file.

Then the VM will automatically call a fstrim on any delete/change command, however this is a high overhead to this, hence it is best left with a weekly cronjob as built into most Linux OS's.
 

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!