From owner-freebsd-current@FreeBSD.ORG Tue May 19 10:21:24 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55F231065670 for ; Tue, 19 May 2009 10:21:24 +0000 (UTC) (envelope-from paul@fletchermoorland.co.uk) Received: from hydra.fletchermoorland.co.uk (hydra.fletchermoorland.co.uk [78.33.209.59]) by mx1.freebsd.org (Postfix) with ESMTP id BAB558FC08 for ; Tue, 19 May 2009 10:21:23 +0000 (UTC) (envelope-from paul@fletchermoorland.co.uk) Received: from [192.168.0.154] (demophon.fletchermoorland.co.uk [192.168.0.154]) by hydra.fletchermoorland.co.uk (8.14.2/8.14.2) with ESMTP id n4JALMYM099474; Tue, 19 May 2009 11:21:22 +0100 (BST) (envelope-from paul@fletchermoorland.co.uk) Message-ID: <4A128822.9030709@fletchermoorland.co.uk> Date: Tue, 19 May 2009 11:21:22 +0100 From: Paul Wootton User-Agent: Thunderbird 2.0.0.21 (X11/20090504) MIME-Version: 1.0 To: Max Laier References: <4A1123C5.3070507@fletchermoorland.co.uk> <4A122C23.40603@freebsd.org> <200905190637.03323.max@love2party.net> In-Reply-To: <200905190637.03323.max@love2party.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org Subject: Re: discrepancies in used space after cpio X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2009 10:21:24 -0000 Max Laier wrote: > On Tuesday 19 May 2009 05:48:51 Tim Kientzle wrote: > >> Paul Wootton wrote: >> >>> I am currently in the process of moving all my data around, going >>> from a single zfs drive (ex-mirror) to a zfs raidz. >>> I have used cpio to copy the data to the new pool, but a du shows a >>> big difference in the results. >>> >>> Does anyone have any ideas, or does a "du -h ." not do what I think >>> it should? >>> >> ... ... >> >> >>> demophon# pwd >>> /DemoPool/var/tmp/kdecache-paul/kpc >>> demophon# ls -lah >>> total 1282522 >>> drwx------ 2 paul paul 25B May 15 19:35 . >>> drwx------ 11 paul paul 16B May 15 19:36 .. >>> -rw-r--r-- 1 paul paul 5.0M May 6 16:47 kapman_cache.data >>> -rw-r--r-- 1 paul paul 1.3M May 6 16:47 kapman_cache.index >>> >> ... ... >> >> >>> demophon# du -h . >>> 1.2G . >>> >>> demophon# pwd >>> /var/tmp/kdecache-paul/kpc >>> demophon# ls -lah >>> total 7833 >>> drwx------ 2 paul paul 25B May 18 09:37 . >>> drwx------ 11 paul paul 16B May 18 09:12 .. >>> -rw-r--r-- 1 paul paul 5.0M May 6 16:47 kapman_cache.data >>> -rw-r--r-- 1 paul paul 1.3M May 6 16:47 kapman_cache.index >>> >> ... ... >> >> >>> demophon# du -h . >>> 7.6M . >>> >> Dmitry Morozovsky wrote: >> > Ehmm, possibly stupid question: sparse files? >> >> Dmitry's probably right here: Files .data/.index are >> probably some kind of database package, which are >> often highly sparse files. >> >> Try "du -k *" in each of these directories to see >> how much disk space is actually allocated to each file; >> that would verify that file sparseness is at issue here. >> > > You can also use "du -hA ." to get the apparent size. But, as I assume > that "/DemoPool" is the destination and "/var" is the source of your cpio > copy, it is quite obvious that sparse files are in play at the source. > > Yes /DemoPool is a raidz pool that is going to replace my single disk pool. Dmitry was right about sparse files demophon# pwd /var/tmp/kdecache-paul/kpc demophon# du -hA . 1.2G . demophon# du -h . 8.9M . Is there a there a better way instead of using cpio for moving an entire filing system from a single disk zfs pool to a raidz zfs pool? Or does making a sparse file in to a none sparse file just consume more disk space and no other side affects Cheers Paul