Your kvm guest will likely need a virtual disk. Typically, the virtual disk is stored in a file on the host.
The linux filesystems (ext2, ext3) support a concept of sparse file, that is, files that are larger than the data actually stored on disk.
A sparse file contains holes, or portions of the file that are not allocated. If a program reads the portion of the file that is not allocated, binary zero's are returned.
When a program writes data into a portion of the file which is not allocated, the linux filesystem allocates that portion of the file on-the-fly without an additional program interaction.
Sparse files are convenient in situations where you may not want to allocate all the disk-space for a very large file which will not be used initially, however, there are some special command / handling for sparse files.
When looking at the size of a sparse file you need to use:
ls -ls filename
You will notice that the size of the file, in blocks is smaller than the length of the file (in bytes), this is because there are 'holes' in the file. The size of the file is the number of disk blocks allocated to store the file, where as the length is the total number of bytes you could read from the file (including the holes).
Transferring a huge sparse file over a network
There are a few tricks to this. Some of the command you usually use may not behave the way you want when dealing with a large sparse file.
you probably want to keep the file sparse on the destination.
you want to avoid to transfering all the un-allocated sections of the file.
The program rsync claims to to able to handle sparse files, but I have had problems with it.
This is the trick I use to move a large sparse file, keep it sparse and conserve network bandwidth.
Log into the destination host and cd to directory where you want to place the large, sparse file(s).
ssh root@sourcehost 'cd /dir/on/source/host ; tar zcSf - hugesparsefile.img' | tar xzvSf -
note:
lower-case (zcvf) upper-case: S and the trailing dash is required.
the size of the file may be different on the destination, but the length will match exactly.
you can use the program md5sum (on source and dest) to check the the transferred file is identical.