Sparse file: Difference between revisions
tweak again |
that PDF is not about the same kind of sparse files |
||
Line 17: | Line 17: | ||
* [http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/fsutil_sparse.mspx Creating sparse files in Windows XP Professional using fsutil] |
* [http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/fsutil_sparse.mspx Creating sparse files in Windows XP Professional using fsutil] |
||
* [http://docs.sun.com/app/docs/doc/816-5166/6mbb1kq8r?a=view Creating sparse files in Solaris using mkfile] |
* [http://docs.sun.com/app/docs/doc/816-5166/6mbb1kq8r?a=view Creating sparse files in Solaris using mkfile] |
||
* [http://pages.cs.wisc.edu/~thain/library/sparse.pdf PDF explanation of sparse files] |
|||
* [http://msdn2.microsoft.com/en-us/library/ms175823.aspx Understanding Sparse File Sizes in Database Snapshots] |
* [http://msdn2.microsoft.com/en-us/library/ms175823.aspx Understanding Sparse File Sizes in Database Snapshots] |
||
Revision as of 02:17, 28 November 2007
In computer science, a sparse file is a type of computer file that attempts to use file system space more efficiently. When space has been allocated to a file but not actually filled with data it 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. Most modern Unix file systems support sparse files. Sparse files are commonly used for disk images, database snapshots and log files.
If executed manually, the Unix command:
dd if=/dev/zero of=sparse-file bs=1 count=1 seek=1m
Will create a file of one megabyte in size, but with only one byte actually stored on disk. The advantage of sparse files is that storage is only allocated when actually needed: disk space is saved, and large files can be created even if there is insufficient free space on the file system. Disadvantages are that sparse files may become fragmented; file system free space reports may be misleading; filling up file systems containing sparse files can have unexpected effects; and copying a sparse file with a program that does not explicitly support them may copy the entire size of the file, even those sparse sections which are not on disk—losing the sparse property of the file.
See also
References
- Giampaolo, Dominic (1999). Practical File System Design with the Be File System. Morgan Kaufmann. ISBN 1-55860-497-9