From owner-freebsd-fs@FreeBSD.ORG Fri Aug 28 19:12:27 2009 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57FB01065670 for ; Fri, 28 Aug 2009 19:12:27 +0000 (UTC) (envelope-from rick@kiwi-computer.com) Received: from hamlet.setfilepointer.com (hamlet.SetFilePointer.com [63.224.10.2]) by mx1.freebsd.org (Postfix) with SMTP id 06E428FC08 for ; Fri, 28 Aug 2009 19:12:26 +0000 (UTC) Received: (qmail 42963 invoked from network); 28 Aug 2009 14:12:26 -0500 Received: from keira.kiwi-computer.com (HELO kiwi-computer.com) (63.224.10.3) by hamlet.setfilepointer.com with SMTP; 28 Aug 2009 14:12:26 -0500 Received: (qmail 77542 invoked by uid 2001); 28 Aug 2009 19:12:25 -0000 Date: Fri, 28 Aug 2009 14:12:25 -0500 From: "Rick C. Petty" To: Aragon Gouveia Message-ID: <20090828191225.GA77462@keira.kiwi-computer.com> References: <4A9822FC.2030606@phat.za.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A9822FC.2030606@phat.za.net> User-Agent: Mutt/1.4.2.3i Cc: freebsd-fs@freebsd.org Subject: Re: some of my files have an incorrect block count X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: rick-freebsd2008@kiwi-computer.com List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2009 19:12:27 -0000 On Fri, Aug 28, 2009 at 08:33:32PM +0200, Aragon Gouveia wrote: > > I'm copying data across to a larger file system and in so doing, I've > noticed that some of the files in my old file system have an incorrect > block count. After copying all data, df(1) reports that the new file > system has more data on it than the old one. I've narrowed most of the > difference to one file in particular: Yes, these are called sparse files. Disk images are one example where sparse files come in handy (although some argue that you should fully zero an image initially to prevent fragmentation). Many tools can handle sparse files efficiently. You should read their individual man pages. > If dd(1) reads both files in, it counts the correct size, and running > md5(1) on both copies of the files produces the same hash, so at least > all the data is presumably present. If you want dd to copy sparse files correctly, you need to specify "conv=sparse" in the target dd command. I personally prefer rsync with "-S". > Surely fsck(8) should detect this? No. > Is this inconsistency cause for concern? No. This is just how sparse files work. -- Rick C. Petty