From owner-freebsd-stable@FreeBSD.ORG Mon Jun 23 06:42:10 2008 Return-Path: Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 876611065674 for ; Mon, 23 Jun 2008 06:42:10 +0000 (UTC) (envelope-from krassi@bulinfo.net) Received: from mx.bulinfo.net (mx.bulinfo.net [193.194.156.1]) by mx1.freebsd.org (Postfix) with ESMTP id 3FD938FC19 for ; Mon, 23 Jun 2008 06:42:10 +0000 (UTC) (envelope-from krassi@bulinfo.net) Received: from localhost (localhost [127.0.0.1]) by mx.bulinfo.net (Postfix) with ESMTP id 0C5D821145; Mon, 23 Jun 2008 09:42:08 +0300 (EEST) Received: from mx.bulinfo.net ([127.0.0.1]) by localhost (mx.bulinfo.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 23047-06; Mon, 23 Jun 2008 09:42:07 +0300 (EEST) Received: from [192.168.2.188] (pythia.bulinfo.net [212.72.195.5]) by mx.bulinfo.net (Postfix) with ESMTP id 236A12114A; Mon, 23 Jun 2008 09:42:06 +0300 (EEST) Message-ID: <485F45BE.3030204@bulinfo.net> Date: Mon, 23 Jun 2008 09:42:06 +0300 From: Krassimir Slavchev User-Agent: Thunderbird 2.0.0.14 (X11/20080616) MIME-Version: 1.0 To: Oliver Fromme References: <200806202048.m5KKmgo6073726@lurza.secnetix.de> In-Reply-To: <200806202048.m5KKmgo6073726@lurza.secnetix.de> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at mx.bulinfo.net Cc: freebsd-stable@FreeBSD.ORG Subject: Re: Incorrect file size? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jun 2008 06:42:10 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Oliver Fromme wrote: > Ivan Voras wrote: > > Rink Springer wrote: > > > The 'vscan' user leads me assume this is SpamAssassin - I've seen this > > > behaviour at work, where our scripts were trying to backup a 1TB file > > > (which actually was ~vscan/.spamassassin/auto-whitelist). The result was > > > that the backup script died due to lack of disk space on the backup > > > server (as we don't use compression). > > > > > > When I was investigating why the file could be so large it, it turned > > > out the file was only a few hunderd 'real' MB's, so that is why I assume > > > this person is having the same issue as we do. The file is a Berkeley DB > > > file, by the way, so there's nothing textfile about it ;-) > > > > I learn something every day :) > > Didn't know BDB was smart enough to create sparse files. > > BTW, you can use "ls -ls" to display the number of physical > blocks allocated to the file, so you can easily see whether > a file is sparse or not: > > $ dd if=/dev/zero of=foo1 bs=1m count=1 > $ truncate -s 1m foo2 > $ ls -ls foo1 foo2 > 1040 -rw------- 1 olli olli 1048576 Jun 20 22:43 foo1 > 32 -rw------- 1 olli olli 1048576 Jun 20 22:43 foo2 # ls -lsk total 1247288 664064 -rw------- 1 vscan vscan 4398199488512 Jun 23 09:39 auto-whitelist 88 -rw------- 1 vscan vscan 89976 Jun 23 09:39 bayes_journal 566704 -rw------- 1 vscan vscan 1099639861248 Jun 23 09:39 bayes_seen 16432 -rw------- 1 vscan vscan 21454848 Jun 23 09:39 bayes_toks > > As you can see, the file size is the same, but the block > counts are different (I have BLOCKSIZE=K in my environment, > so the blocks are displayed in 1KB units). > > I've written a small script that can be used to detect > sparse files (it even displays the "sparseness" percentage): > > http://www.secnetix.de/olli/scripts/sparsecheck > > Best regards > Oliver > > PS: Of course it is still possible that a file system is > corrupt and needs fsck, no matter whether those files are > sparse or not. > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFIX0W+xJBWvpalMpkRAqrdAJ47eLQ+WMp6zBrme5gNyCSvzBtdUwCffYwT +37ul1gPqmk7rVKXRrha7fU= =uSGe -----END PGP SIGNATURE-----