Sparse files have become pretty common in the virtualization arena, since they allow you to present a large chunks of disk space to guests without having to reserve the space in an actual backing store. This has a couple of benefits:
To create a sparse file on a Linux host, you can run dd with a count size of zero (this tells dd not to write any data to the file), and then use the seek option to extend the file to the desired size:
$ dd if=/dev/zero of=xen-guest.img bs=1 count=0 seek=8G
Once the sparse fie is created, you can use dd to verify how much space is allocated to it:
$ du -sh xen-guest.img
0 xen-guest.img
$ du -sh --apparent-size xen-guest.img
8.0G xen-guest.img
Sparse files are extremely handy, though it’s important to know when and when not to use them.