Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Sep 1995 08:44:47 -0700 (MST)
From:      Terry Lambert <>
To: (Lars Koeller)
Subject:   Re: Discrepance between df/du/tar!
Message-ID:  <>
In-Reply-To: <> 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
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: <>