Compress RAW image to free up space on host

Apr 20, 2016
Dear community,

I have a few VMs which were initially created with QEMU2, later migrated to RAW due to performance reasons.
These are running normal EXT4 filesystems (no LVM) with 800GB allocated in size. The file systems are only in use by 10-20%, however, on the host the total storage of 1.8TB shows 90% full.

I would like to keep the file-system sizes of the VMs (hence no shrinking of the VM filesystems desired) but free up the disk space on the host.

Is there an easy way to do this ? E.g. similar to the initial thin provisioning RAW also seems to do similar to QEMU2 when creating a new VM on the host ?

Thanks all!
Hi Dietmar,

unfortunately fstrim is not supported in the guest:

fstrim -v /
fstrim: /: FITRIM ioctl failed: Die Operation wird nicht unterstützt
to do trim the whole chain must support this. The normal virtio-driver don't support trim!
Use scsi instead with scsi controller virtio
select discard on the VM-disk
Your storage must also accept the trim (afaik not possible on raid-controller)

Thanks Udo.

The system is running on a Raid 10 SSD environment with Hardware Raid Controller (HP Server). Any other suggestions to get the RAW images smaller to reflect the true guests usage size again (comparable to the initial provisioning) ?

Thanks all!


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!