D
D
desecho2012-03-29 23:40:43
linux
desecho, 2012-03-29 23:40:43

KVM and sparse files

I create a "hard drive" file with this command:
qemu-img create -o preallocation=metadata -f qcow2 test.img 20G
The file is created, small in size. But after partitioning the disk and installing the system, the file immediately starts to weigh 20GB.
How can I make the file grow gradually and not immediately occupy 20GB?

UPD. Understood everything. Everything works fine. I just didn’t know what to use ls -s to view the real size

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rasa, 2012-03-30
@rasa

What Linux do you have? metadata preallocation on QCOW2 is not always supported.
help.ubuntu.ru/wiki/kvm - The guest system should immediately see this final specified size, however, during the installation phase, it can see the real size of the file. Naturally, it will refuse to be installed on a 200 kb hard drive. The bug is not specific to Ubuntu, it also appears in RHEL, at least.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question