From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mfqcf-0006N9-PI for qemu-devel@nongnu.org; Tue, 25 Aug 2009 03:39:17 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mfqcb-0006MK-9q for qemu-devel@nongnu.org; Tue, 25 Aug 2009 03:39:17 -0400 Received: from [199.232.76.173] (port=33312 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mfqcb-0006MH-47 for qemu-devel@nongnu.org; Tue, 25 Aug 2009 03:39:13 -0400 Received: from mx20.gnu.org ([199.232.41.8]:60151) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mfqca-0005PU-OE for qemu-devel@nongnu.org; Tue, 25 Aug 2009 03:39:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MfqcZ-00033g-KV for qemu-devel@nongnu.org; Tue, 25 Aug 2009 03:39:11 -0400 Message-ID: <4A9394D7.6070603@redhat.com> Date: Tue, 25 Aug 2009 09:37:59 +0200 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] diskimage HOWTO References: <4A9245EA.9030108@redhat.com> <4A938D63.8020906@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mulyadi Santosa Cc: qemu-devel@nongnu.org, Bai Shuwei Mulyadi Santosa schrieb: > On Tue, Aug 25, 2009 at 2:06 PM, Kevin Wolf wrote: >> You shouldn't have removed half of my answer. Using kpartx is so much >> easier than fiddling around with offsets. > > Sorry for that Kevin. I was focusing on losetup, because that's the > one I am familiar of. Could you kindly demonstrate how to use kpartx > in this case? Thanks in advance... You would use "kpartx -a test.img" which creates devices like /dev/mapper/loop0p1 for each partition. You can work with it like you would do with losetup and afterwards remove it with "kpartx -d test.img". But actually Laurent's solution doesn't look too bad either. Didn't know about it until now. Kevin