From owner-freebsd-questions Fri Sep 15 16:00:13 1995 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id QAA13292 for questions-outgoing; Fri, 15 Sep 1995 16:00:13 -0700 Received: from ref.tfs.com (ref.tfs.com [140.145.254.251]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id QAA13284 for ; Fri, 15 Sep 1995 16:00:11 -0700 Received: (from julian@localhost) by ref.tfs.com (8.6.11/8.6.9) id PAA01194; Fri, 15 Sep 1995 15:59:31 -0700 From: Julian Elischer Message-Id: <199509152259.PAA01194@ref.tfs.com> Subject: Re: Discrepance between df/du/tar! To: terry@lambert.org (Terry Lambert) Date: Fri, 15 Sep 1995 15:59:31 -0700 (PDT) Cc: lars.koeller@odie.physik2.uni-rostock.de, freebsd-questions@freefall.freebsd.org In-Reply-To: <199509151544.IAA01184@phaeton.artisoft.com> from "Terry Lambert" at Sep 15, 95 08:44:47 am X-Mailer: ELM [version 2.4 PL24] Content-Type: text Content-Length: 1643 Sender: owner-questions@FreeBSD.org Precedence: bulk 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. >