From owner-freebsd-questions Sat Jul 24 14:44:31 1999 Delivered-To: freebsd-questions@freebsd.org Received: from scientia.demon.co.uk (scientia.demon.co.uk [212.228.14.13]) by hub.freebsd.org (Postfix) with ESMTP id 287D414D4D for ; Sat, 24 Jul 1999 14:44:27 -0700 (PDT) (envelope-from ben@scientia.demon.co.uk) Received: from lithium.scientia.demon.co.uk ([192.168.1.2] ident=exim) by scientia.demon.co.uk with esmtp (Exim 3.02 #1) id 1188g2-0008Ml-00; Sat, 24 Jul 1999 21:45:51 +0100 (envelope-from ben@lithium.scientia.demon.co.uk) Received: from lithium.scientia.demon.co.uk (ident=ben) by lithium.scientia.demon.co.uk with local (Exim 3.02 #1) id 1188fu-00024Q-00; Sat, 24 Jul 1999 21:45:42 +0100 (envelope-from ben@lithium.scientia.demon.co.uk) Date: Sat, 24 Jul 1999 21:45:41 +0100 From: Ben Smithurst To: "Vadim V. Chepkov" Cc: freebsd-questions@freebsd.org Subject: Re: Strange disk usage Message-ID: <19990724214541.A7868@lithium.scientia.demon.co.uk> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.4i In-Reply-To: Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Vadim V. Chepkov wrote: > How is it possible? FreeBSD 3.2-STABLE > > su-2.03# ls -l /var/proxy/ > total 192 > -rw-r--r-- 1 root wheel 2013270016 Jul 24 22:27 oops_storage1 > -rw-r--r-- 1 root wheel 2013270016 Jul 24 22:27 oops_storage2 > > su-2.03# du /var/proxy > 193 /var/proxy The files have holes in them, I'd imagine. Basically, files get holes in them if you seek past the end of the file and write. Between the original end of the file, and the bit where you started writing, is a hole. Reading in this space returns zeroes. The difference shown above is because `ls' shows the size of the file (st_size field of data obtained with stat()), while du and df presumably count the number of blocks actually used on the filesystem. As for *why* this has happened, well, that's another question altogether... The 4.4BSD book by McKusick et al will probably explain it better. It's worth buying, IMO, if you haven't already. -- Ben Smithurst | PGP: 0x99392F7D ben@scientia.demon.co.uk | key available from keyservers and | ben+pgp@scientia.demon.co.uk To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message