From owner-freebsd-questions@FreeBSD.ORG Mon Nov 3 17:12:33 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 510A310656B4 for ; Mon, 3 Nov 2008 17:12:33 +0000 (UTC) (envelope-from scrappy@hub.org) Received: from hub.org (hub.org [200.46.204.220]) by mx1.freebsd.org (Postfix) with ESMTP id 2042D8FC18 for ; Mon, 3 Nov 2008 17:12:33 +0000 (UTC) (envelope-from scrappy@hub.org) Received: from localhost (unknown [200.46.204.183]) by hub.org (Postfix) with ESMTP id 7C38D11A2D84; Mon, 3 Nov 2008 13:12:32 -0400 (AST) Received: from hub.org ([200.46.204.220]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 67385-07; Mon, 3 Nov 2008 13:12:32 -0400 (AST) Received: from [192.168.1.2] (blk-224-204-104.eastlink.ca [24.224.204.104]) by hub.org (Postfix) with ESMTPA id E176011A2D7B; Mon, 3 Nov 2008 13:12:31 -0400 (AST) Date: Mon, 03 Nov 2008 13:12:30 -0400 From: "Marc G. Fournier" To: Matt Message-ID: In-Reply-To: References: X-Mailer: Mulberry/4.0.8 (Linux/x86) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline Cc: freebsd-questions@freebsd.org 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:33 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Sweet, never even thought about doing that ... thank you ... - --On Monday, November 03, 2008 11:04:22 -0600 Matt wrote: > On Mon, Nov 3, 2008 at 10:40 AM, Marc G. Fournier wrote: >> >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> >> I have a disk img for qemu that is 4G, but disk usage is only 650M ... due to >> how the image is created, it will grow to 4G, but only uses as much as it >> needs ... but, if I run a simple 'cp' on the file, it goes from: >> >> image: debian.img >> file format: raw >> virtual size: 4.0G (4294967296 bytes) >> disk size: 652M >> >> to: >> >> image: dtc.img >> file format: raw >> virtual size: 4.0G (4294967296 bytes) >> disk size: 4.0G >> >> Is there a way of moving things around such that it *maintains* the holes, >> instead of fills them in? >> > The "qemu-img" program using the "convert" command should do what you > want it to. I've used it to make copies of qcow-format disks without > having them grow to their max-size. > > Matt - -- Marc G. Fournier Hub.Org Hosting Solutions S.A. (http://www.hub.org) Email . scrappy@hub.org MSN . scrappy@hub.org Yahoo . yscrappy Skype: hub.org ICQ . 7615664 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkkPMP4ACgkQ4QvfyHIvDvOvRACgyVOSp3nqJgqFQE7Ilm4IXbUZ d+YAnj2lddYnGcLMBzSkXjbk0onRfnZY =+Ft+ -----END PGP SIGNATURE-----