From owner-freebsd-questions@FreeBSD.ORG Mon Nov 3 17:04:23 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 CFA9F106564A for ; Mon, 3 Nov 2008 17:04:23 +0000 (UTC) (envelope-from datahead4@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.190]) by mx1.freebsd.org (Postfix) with ESMTP id 5EDDD8FC16 for ; Mon, 3 Nov 2008 17:04:23 +0000 (UTC) (envelope-from datahead4@gmail.com) Received: by nf-out-0910.google.com with SMTP id h3so1053363nfh.33 for ; Mon, 03 Nov 2008 09:04:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=7x/W3svI7NnhP1Jo3RnJKQqUEsrIRwrInql7PW+kdJE=; b=gq0UlD9LHnIeVPwrWxOzxQRd0kUdx52LwuBMItokL5Ze4pla8PjanByxHYvTrHJ3zr yzP6pkNtD4XKnPzQUsmQhR9I+j/GoLTf29rI8VI1Xfb8ipkyQH2/RvCA61TYrOqKY97E C+U2X1EJ4xG3AhO9Dp8rnmJ7TNIqUxQe7e9WE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=V5QsvVjki9uEl4zAGA7pN9uMlozrAEh/o/ea17K5+UzzaSgssYPiPRBV23CDFfsnbT F0W6eNZMblFRBf8Z45M2qHMOrZeeRafSCHTJwaE9KC8mFRAQW0cCPtltJoF6wGsoQT/Q JCNYii2fhy0gZ2xWiy7Iehnonlvzi7igMKlnQ= Received: by 10.210.37.11 with SMTP id k11mr356561ebk.153.1225731862183; Mon, 03 Nov 2008 09:04:22 -0800 (PST) Received: by 10.210.134.8 with HTTP; Mon, 3 Nov 2008 09:04:22 -0800 (PST) Message-ID: Date: Mon, 3 Nov 2008 11:04:22 -0600 From: Matt To: "Marc G. Fournier" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: 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:04:23 -0000 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