Truncate RAW disk image

ppo

Renowned Member
Aug 6, 2012
49
0
71
I've faced with such trouble with one of my first VM, that I want to copy through Internet.
I crated this KVM with raw disk image due performance suggestion. But in future I never saw a performance differences between raw and qcow2. But qcow2 is more useful, especially with disk usage consumption.
Recently I've found this article:
http://schlutech.com/2012/02/truncate-kvmqemu-raw-disk-image/
and I want to ask community is it save to do such thing, is someone did a similar?
Any other suggestions would be very helpful.
Code:
root@proxmox:~# ls -lah /var/lib/vz/images/102/vm-102-disk-1.raw 
-rw-r--r-- 1 root root 5.0G Jun 17 09:14 /var/lib/vz/images/102/vm-102-disk-1.raw
root@proxmox:~# du -sch /var/lib/vz/images/102/vm-102-disk-1.raw 
4.6G    /var/lib/vz/images/102/vm-102-disk-1.raw
root@proxmox:~# ls -lah /mnt/pve/remote/dump/vzdump-qemu-102-2013_06_17-09_06_24.tar.gz 
-rw-r--r-- 1 root root 2.4G Jun 17 09:10 /mnt/pve/remote/dump/vzdump-qemu-102-2013_06_17-09_06_24.tar.gz
[root@vm-102 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_rm2-lv_root
                      4.0G  1.7G  2.1G  45% /
tmpfs                 492M     0  492M   0% /dev/shm
/dev/vda1             485M   65M  395M  15% /boot
none                  492M  8.0K  492M   1% /tmp
 

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!