From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CB4AA-0007Dt-Lw for qemu-devel@nongnu.org; Sat, 25 Sep 2004 00:27:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CB4A8-0007Cy-U9 for qemu-devel@nongnu.org; Sat, 25 Sep 2004 00:27:58 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CB4A8-0007Co-O5 for qemu-devel@nongnu.org; Sat, 25 Sep 2004 00:27:56 -0400 Received: from [206.124.138.239] (helo=pdx.silverbeach.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CB43y-00042g-9w for qemu-devel@nongnu.org; Sat, 25 Sep 2004 00:21:34 -0400 Received: from localhost (localhost [127.0.0.1]) by pdx.silverbeach.net (Postfix) with ESMTP id 2C1481BF76C for ; Fri, 24 Sep 2004 21:21:38 -0700 (PDT) From: Kyle Hayes Subject: Re: [Qemu-devel] qemu dd sizes Date: Fri, 24 Sep 2004 21:21:36 -0700 References: <20040925021551.1B4643DDA@xprdmailfe12.nwk.excite.com> In-Reply-To: <20040925021551.1B4643DDA@xprdmailfe12.nwk.excite.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200409242121.36640.kyle@silverbeach.net> Reply-To: kyle@silverbeach.net, qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Friday 24 September 2004 19:15, jmf wrote: > When using dd to create a disk image to boot through qemu, does the > block size really matter, or can I omit that parameter? If the size of > the original disk is 20 gb but there is only 2 gb of data on the disk, > how can I make the image size smaller? It is a little unclear what you are asking here. dd uses the block size and a count in order to determine how much to copy. If you are making a file with holes in it, you can use a block size, offset and then set count=0. If you omit the count and block size, it will use the default block size (512 bytes I think) and will simply copy until either the source runs out of data or the destination runs out of space. If there is 2GB, it depends what the original filesystem was. Ext2/3 (under Linux) puts data all over the disk in a sparse manner. So, just copying the first 2GB would not get all the data. If it is a Windows partition and you are using VFAT, then running the defragmenter program will push all the data to one end of the disk (beginning?). With NTFS, I'm not sure what happens. You could try to resize the 20GB partition down to 2.5GB and then copy that with dd. What kind of filesystem is it? Best, Kyle