Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Sep 1995 08:44:47 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        lars.koeller@odie.physik2.uni-rostock.de (Lars Koeller)
Cc:        freebsd-questions@freefall.freebsd.org
Subject:   Re: Discrepance between df/du/tar!
Message-ID:  <199509151544.IAA01184@phaeton.artisoft.com>
In-Reply-To: <199509150855.KAA01129@odie.physik2.uni-rostock.de> from "Lars Koeller" at Sep 15, 95 10:55:29 am

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
>       I'm    running FreeBSD-2.0.5R and  there is   a missmatch between the
>    occupied disk space 'df' and 'du/gtar'!
> 
>       *	df:
> 
> 	Filesystem  1K-blocks     Used    Avail Capacity  Mounted on
> 	/dev/sd0a       68735    31516    31720    50%    /
> 
>       *	du -skx: 22943 
> 
>       *	with GNU level-0 backup script for root filesystem:
> 
> 	tar cpvl --totals /: Total bytes written: 23142400
> 
>    where are the difference of approx 9 MB???

Files with blocks containing nothing but 0's in them are not necessarily
allocated real blocks.  You create these by seeking to an offset and
writing.  All blocks prior to the seek offset are zero'ed.

This is called a sparse file.

Most likely you have several sparse file on your box, including your
password databases and mail aliases.

GNU tar has an option to not save these blocks to tape.  You should use
it, or when you restore your files, they will grow and potentially take
more disk space than you really have.

Try an experiment: open a file, seek to some offset, like 1G, and write
one 512b block.

Then ls -l the file.

Do this on a 40M drive.  It will look like you have a 1G file.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?199509151544.IAA01184>