What is a sparse file?
"A sparse file is a file where space has been allocated but not actually filled with data. These space is not written to the file system. Instead, brief information about these empty regions is stored, which takes up much less disk space. These regions are only written to disk at their actual size when data is written to them. The file system transparently converts reads from empty sections into blocks filled with zero bytes at runtime." [1]
In other words: Files are not as big as expected.
With databases this can be seen often: For example the MySQL Cluster REDO log files are created as sparse files or some ORACLE tablespace files.
But first let us create such a sparse file:
# dd if=/dev/zero of=sparsefile count=0 obs=1 seek=100G # ls -lah sparsefile -rw-r--r-- 1 oli users 100G 2007-10-24 11:18 sparsefile # df -h . Filesystem Size Used Avail Use% Mounted on …[Read more]