[PVE-User] New qcow2 hard disk creates a file with full disk size.

"[SOLTECSIS] Carles Xavier Munyoz Baldó" carles at unlimitedmail.org
Wed Jan 23 11:39:26 CET 2013


Hello Dietmar,
Thank you for your answer.

Best regards.


On 23/01/13 10:27, Dietmar Maurer wrote:
>> I have seen that when I create a new qcow2 hard disk, the file created in the
>> storate (a DRBD directory with ext4 file system) has the full size I have
>> assigned to that hard disk.
>>
>> For example, I have created a new 32GB qcow2 hard disk for a KVM vitual
>> machine with ID 100. Before installing nothing into the virtual machine, if I
>> execute the command ls -al I get:
>> [...]
>> -rw-r--r-- 1 root root 34365243392 Jan 23 10:01 vm-100-disk-1.qcow2 [...]
>> That is, the file has already the 32GB that I have setup for the new hard disk.
>> Why?
>
> Yes, we pre-allocate metadata now.
>
>> Before the last Proxmox update, when I created a new qcow2 hard drive the
>> new file has only a few megabytes.
>>
>> But if I execute the command du -sh over the virtual machine directory I
>> get:
>> [...]
>> 5.5M
>> [...]
>
>
> The file is 'sparse', so it actually uses only a few MBs.
>
>> If I copy the file to another computer, the copy has the 32GB too and if I
>> execute du -sh over the file I get the 32GB size.
>
> You need to use a tool which can copy sparse files (rsync).
>
>

========================================
SOLTECSIS SOLUCIONES TECNOLOGICAS, S.L.
Carles Xavier Munyoz Baldó
Departamento de Tecnología
Tel./Fax: 966 446 046
cmunyoz at soltecsis.com
www.soltecsis.com
========================================

---
La información contenida en este e-mail es confidencial,
siendo para uso exclusivo del destinatario arriba mencionado.
Le informamos que está totalmente prohibida cualquier
utilización, divulgación, distribución y/o reproducción de
esta comunicación sin autorización expresa en virtud de la
legislación vigente. Si ha recibido este mensaje por error,
le rogamos nos lo notifique inmediatamente por la misma vía
y proceda a su eliminación.
---



More information about the pve-user mailing list