<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://aznot.com/index.php?action=history&amp;feed=atom&amp;title=Sparse_File</id>
	<title>Sparse File - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://aznot.com/index.php?action=history&amp;feed=atom&amp;title=Sparse_File"/>
	<link rel="alternate" type="text/html" href="https://aznot.com/index.php?title=Sparse_File&amp;action=history"/>
	<updated>2026-05-07T00:51:48Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://aznot.com/index.php?title=Sparse_File&amp;diff=2873&amp;oldid=prev</id>
		<title>Kenneth at 23:02, 8 February 2016</title>
		<link rel="alternate" type="text/html" href="https://aznot.com/index.php?title=Sparse_File&amp;diff=2873&amp;oldid=prev"/>
		<updated>2016-02-08T23:02:47Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== File System Support ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Unixy&amp;quot; filesystems : ext2, ext3, ufs, xfs, reiserfs, jfs,... all support Sparse files&lt;br /&gt;
&lt;br /&gt;
FAT16 and FAT32 do not&lt;br /&gt;
&lt;br /&gt;
NTFS does support Sparse files&lt;br /&gt;
&lt;br /&gt;
References:&lt;br /&gt;
* Sparse files - MLDonkey - http://mldonkey.sourceforge.net/Sparse_files#FAT16.2C_FAT32&lt;br /&gt;
* File System Functionality Comparison (Windows) - https://msdn.microsoft.com/en-us/library/windows/desktop/ee681827%28v=vs.85%29.aspx&lt;br /&gt;
&lt;br /&gt;
== Sparse File ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Sparse_file Wiki: Sparse Files]&lt;br /&gt;
&lt;br /&gt;
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, meta-information about these &amp;quot;empty&amp;quot; regions is stored until they are filled with data.&lt;br /&gt;
&lt;br /&gt;
The obvious advantage of sparse files is that storage is only allocated when actually needed. Large files can be created even if there isn&amp;#039;t enough free space yet. A disadvantage is that sparse files can become very fragmented. Also, filling up partitions to the maximum can have unpleasant effects.&lt;br /&gt;
&lt;br /&gt;
Will create a file of one megabyte in size, but with only one byte actually stored on disk:&lt;br /&gt;
 dd if=/dev/zero of=sparse-file bs=1 count=1 seek=1M&lt;br /&gt;
&lt;br /&gt;
== Sparse Tools ==&lt;br /&gt;
&lt;br /&gt;
View sparse size (in blocks)&lt;br /&gt;
 # both will report the full file size, but the block size will show sparse size&lt;br /&gt;
 ls -ls [file]&lt;br /&gt;
 stat [file]&lt;br /&gt;
&lt;br /&gt;
 du -s -B1 --apparent-size sparse-file&lt;br /&gt;
 du -s -B1 sparse-file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
tar&lt;br /&gt;
 -S, --sparse	# handle sparse files efficiently&lt;br /&gt;
&lt;br /&gt;
cp - # control creation of sparse files&lt;br /&gt;
 # cp tries to detect sparse files automatically.  This control can be forced&lt;br /&gt;
 cp --sparse=WHEN [...]&lt;br /&gt;
 # --sparse=auto&lt;br /&gt;
 # --sparse=always&lt;br /&gt;
 # --sparse=never&lt;br /&gt;
&lt;br /&gt;
 man cp:&lt;br /&gt;
   By  default,  sparse SOURCE files are detected by a crude heuristic and&lt;br /&gt;
   the corresponding DEST file is made sparse as well.  That is the behav-&lt;br /&gt;
   ior  selected  by  --sparse=auto.   Specify --sparse=always to create a&lt;br /&gt;
   sparse DEST file whenever  the  SOURCE  file  contains  a  long  enough&lt;br /&gt;
   sequence  of  zero  bytes.   Use  --sparse=never to inhibit creation of&lt;br /&gt;
   sparse files.&lt;br /&gt;
&lt;br /&gt;
This is especially useful if a sparse-file has somehow become non-sparse (i.e. the empty blocks have been written out to disk in full). Disk space can be recovered by doing:&lt;br /&gt;
 cp --sparse=always formerly-sparse-file recovered-sparse-file&lt;br /&gt;
&lt;br /&gt;
rsync&lt;br /&gt;
 -S, --sparse	# handle sparse files efficiently&lt;br /&gt;
 rsync -aP --sparse local-file remote-host:remote-file&lt;br /&gt;
&lt;br /&gt;
cpio&lt;br /&gt;
 --sparse&lt;br /&gt;
&lt;br /&gt;
Not supported tools:&lt;br /&gt;
 # Using such a utility would make a sparse file balloon in size.&lt;br /&gt;
 pax, scp, sftp, and ftp&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== keywords ==&lt;br /&gt;
&lt;br /&gt;
sparse file&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;/div&gt;</summary>
		<author><name>Kenneth</name></author>
	</entry>
</feed>