Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Jul 1999 21:45:41 +0100
From:      Ben Smithurst <ben@scientia.demon.co.uk>
To:        "Vadim V. Chepkov" <vvc@kharkiv.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Strange disk usage
Message-ID:  <19990724214541.A7868@lithium.scientia.demon.co.uk>
In-Reply-To: <Pine.BSF.4.10.9907242239500.1819-100000@hut.kharkiv.net>
References:  <Pine.BSF.4.10.9907242239500.1819-100000@hut.kharkiv.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990724214541.A7868>