From: Matt Giwer on
On 05/11/2010 10:30 PM, Robert Nichols wrote:
> On 05/11/2010 09:46 AM, unruh wrote:
>> From
>> http://administratosphere.wordpress.com/2008/05/23/sparse-files-what-why-and-how/
>>
>> "Sparse files are basically just like any other file except that blocks
>> that only contain zeros (i.e., nothing) are not actually stored on disk.
>> This means you can have an apparently 16G file ? with 16G of ?data? ?
>> only taking up 1G of space on disk"
>>
>> Thus du will report all 16GB, while df will report 1GB.
>
> No, 'du' will report 1GB unless you use the "--apparent-size" option.
>
> $ dd if=/dev/zero of=junk bs=1k seek=100000 count=1
> 1+0 records in
> 1+0 records out
> 1024 bytes (1.0 kB) copied, 0.000105715 s, 9.7 MB/s
> $ ls -ls junk
> 12 -rw-rw-r--. 1 rnichols rnichols 102401024 2010-05-11 21:23 junk
> $ du junk
> 12 junk
> $ du --apparent-size junk
> 100001 junk

That might explain it. I don't claim to be an expert only experienced in
explaining the dumb things I do.

--
All squattertowns beyond the Green Line are considered by the world to be
criminal. Why are not those who live in them arrested as criminals?
-- The Iron Webmaster, 4253
http://www.giwersworld.org/00_files/zion-hit-points.phtml a16
Jews stole the land. The owners want it back. a16
Sun May 16 05:36:59 EDT 2010