From owner-freebsd-questions Fri Sep 15 08:46:42 1995 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id IAA13792 for questions-outgoing; Fri, 15 Sep 1995 08:46:42 -0700 Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id IAA13775 for ; Fri, 15 Sep 1995 08:46:34 -0700 Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id IAA01184; Fri, 15 Sep 1995 08:44:47 -0700 From: Terry Lambert Message-Id: <199509151544.IAA01184@phaeton.artisoft.com> Subject: Re: Discrepance between df/du/tar! To: lars.koeller@odie.physik2.uni-rostock.de (Lars Koeller) Date: Fri, 15 Sep 1995 08:44:47 -0700 (MST) Cc: freebsd-questions@freefall.freebsd.org In-Reply-To: <199509150855.KAA01129@odie.physik2.uni-rostock.de> from "Lars Koeller" at Sep 15, 95 10:55:29 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 1301 Sender: owner-questions@FreeBSD.org Precedence: bulk > 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.