VM image file full after gzip gunzip

mikemo

New Member
Nov 12, 2012
3
0
1
I'm using Proxmox 2.1 and needed to move an image file (vm-100-disk-1.raw). I compressed it with gzip, moved it and then later brought it back to the Proxmox host server and unzipped it. Before the process it showed the following disk info:

root@host1:/var/lib/vz/images/100# qemu-img info vm-100-disk-1.raw
image: vm-100-disk-1.raw
file format: raw
virtual size: 32G (34359738368 bytes)
disk size: 4.1G

After compressing and uncompressing with gzip and gunzip:

root@host1:/var/lib/vz/images/100# qemu-img info vm-100-disk-1.raw
image: vm-100-disk-1.raw
file format: raw
virtual size: 32G (34359738368 bytes)
disk size: 32G

When I do df in the VM things still look fine.

Can someone help me to recover the disk space.
thanks in advance.
 
copy the image file using the '--sparse=always' should help (see 'man cp')

dietmar, it looks like this is working. I'm not finished because this is my backup server and I have 4 2TB hard drive images for the VM but it looks good. thanks for the help.
 
Looks like this took care of the issue. I'm not done yet because I have 4 2TB drives for this VM but what I have done looks good. Thanks for the help