From owner-freebsd-questions@FreeBSD.ORG Mon Nov 3 17:12:22 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AD011065678 for ; Mon, 3 Nov 2008 17:12:22 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from smtprelay09.ispgateway.de (smtprelay09.ispgateway.de [80.67.29.23]) by mx1.freebsd.org (Postfix) with ESMTP id EBE238FC16 for ; Mon, 3 Nov 2008 17:12:21 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from [88.153.0.16] (helo=localhost) by smtprelay09.ispgateway.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1Kx2yS-0008Qq-EY for freebsd-questions@freebsd.org; Mon, 03 Nov 2008 18:12:20 +0100 Date: Mon, 3 Nov 2008 18:12:14 +0100 From: Fabian Keil To: freebsd-questions@freebsd.org Message-ID: <20081103181214.1adafa2b@fabiankeil.de> In-Reply-To: References: X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.11; i386-portbld-freebsd8.0) X-PGP-KEY-URL: http://www.fabiankeil.de/gpg-keys/freebsd-listen-2008-08-18.asc Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/6l_Hy92jvYkJ5m6jUOcSawA"; protocol="application/pgp-signature"; micalg=PGP-SHA1 X-Df-Sender: 775067 Subject: Re: copying 'holey' files ... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 17:12:22 -0000 --Sig_/6l_Hy92jvYkJ5m6jUOcSawA Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable "Marc G. Fournier" wrote: > I have a disk img for qemu that is 4G, but disk usage is only 650M ... du= e to=20 > how the image is created, it will grow to 4G, but only uses as much as it= needs=20 > ... but, if I run a simple 'cp' on the file, it goes from: >=20 > image: debian.img > file format: raw > virtual size: 4.0G (4294967296 bytes) > disk size: 652M >=20 > to: >=20 > image: dtc.img > file format: raw > virtual size: 4.0G (4294967296 bytes) > disk size: 4.0G >=20 > Is there a way of moving things around such that it *maintains* the holes= ,=20 > instead of fills them in? Quoting dd(1): | conv=3Dvalue[,value ...] | Where value is one of the symbols from the following list. [...] | sparse If one or more output blocks would consist solely of | NUL bytes, try to seek the output file by the required | space instead of filling them with NULs, resulting in a | sparse file. I haven't actually tested it with qemu images, though. Fabian --Sig_/6l_Hy92jvYkJ5m6jUOcSawA Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkkPMO4ACgkQBYqIVf93VJ1AngCfYPUvWuqNSLF4IZdINybQvgy8 MfEAoKvWf0GAzXA3PrWcKHWwh/ni1udt =jCjf -----END PGP SIGNATURE----- --Sig_/6l_Hy92jvYkJ5m6jUOcSawA--