Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Sep 1995 15:59:31 -0700 (PDT)
From:      Julian Elischer <julian@ref.tfs.com>
To:        terry@lambert.org (Terry Lambert)
Cc:        lars.koeller@odie.physik2.uni-rostock.de, freebsd-questions@freefall.freebsd.org
Subject:   Re: Discrepance between df/du/tar!
Message-ID:  <199509152259.PAA01194@ref.tfs.com>
In-Reply-To: <199509151544.IAA01184@phaeton.artisoft.com> from "Terry Lambert" at Sep 15, 95 08:44:47 am

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
Terry: it's the other way around.. 
df is showing more than du, and  tar..

my guesses are:
1/ a lot of files using 'part' of a last block (more than a frag but less
than a block, OR
2/ you've mounted a filesystem over a directory that contains files?


> >       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?199509152259.PAA01194>