Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 May 2009 06:37:02 +0200
From:      Max Laier <max@love2party.net>
To:        freebsd-current@freebsd.org
Cc:        Tim Kientzle <kientzle@freebsd.org>, Paul Wootton <paul@fletchermoorland.co.uk>
Subject:   Re: discrepancies in used space after cpio
Message-ID:  <200905190637.03323.max@love2party.net>
In-Reply-To: <4A122C23.40603@freebsd.org>
References:  <4A1123C5.3070507@fletchermoorland.co.uk> <4A122C23.40603@freebsd.org>

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

-- 
/"\  Best regards,                      | mlaier@freebsd.org
\ /  Max Laier                          | ICQ #67774661
 X   http://pf4freebsd.love2party.net/  | mlaier@EFnet
/ \  ASCII Ribbon Campaign              | Against HTML Mail and News




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