[PVE-User] Problem with sparse files disks
Fabien Bagard
fabien.bagard at intersec.com
Fri Apr 23 11:58:41 CEST 2010
Hi all!
First of all, thank you for this wonderful enterprise-class suite !
I use PVE since 2 weeks from now, and I encountered some problems
---
All my VMs uses sparse files as disks (raw format). I wanted to migrate
all my VMs from a server to another (same characteristics, same disk
space, ...) After a while, I got an error, no space left on device. I
checked VM disks size with du -sm. The surprise was : On the master, a
50Go disk reported a size of 1Go (normal, it's a sparse file), but once
migrated, it reported a size of 50Go... Maybe you should consider using
the '-S' option of rsync (handling sparse files). But I don't know what
is the effect of -S option on a non-sparse file.
For those who are stuck with non-sparse files after a migration, it is
possible to recreate them, without any loss of data :
bender:/var/lib/vz/images/100# du -sm vm-100-disk-1.raw
51251 vm-100-disk-1.raw
Convert the big disk in another format, for example qcow2 : qemu-img
convert -f raw -O qcow2 vm-100-disk-1.raw vm-100-disk-1.qcow2
bender:/var/lib/vz/images/100# du -sm vm-100-disk-1.qcow2
890 vm-100-disk-1.qcow2
then convert it back to raw format : qemu-img convert -f qcow2 -O raw
vm-100-disk-1.qcow2 vm-100-disk-1.raw
bender:/var/lib/vz/images/100# du -sm vm-100-disk-1.raw
828 vm-100-disk-1.raw
By the way, we can see that raw format is lighter than qcow2 ;)
---
Thank you again for you wonderful job ! PVE is exactly what I needed !
More information about the pve-user
mailing list