From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mfq7s-0004j9-Hp for qemu-devel@nongnu.org; Tue, 25 Aug 2009 03:07:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mfq7o-0004ev-Oj for qemu-devel@nongnu.org; Tue, 25 Aug 2009 03:07:28 -0400 Received: from [199.232.76.173] (port=60795 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mfq7o-0004eq-Md for qemu-devel@nongnu.org; Tue, 25 Aug 2009 03:07:24 -0400 Received: from mx20.gnu.org ([199.232.41.8]:58338) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mfq7o-0000Jt-2c for qemu-devel@nongnu.org; Tue, 25 Aug 2009 03:07:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mfq7k-0001Fs-Qw for qemu-devel@nongnu.org; Tue, 25 Aug 2009 03:07:21 -0400 Message-ID: <4A938D63.8020906@redhat.com> Date: Tue, 25 Aug 2009 09:06:11 +0200 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] diskimage HOWTO References: <4A9245EA.9030108@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 Mon, Aug 24, 2009 at 2:48 PM, Kevin Wolf wrote: >> Bai Shuwei schrieb: >>> Hi, All: >>> I want to build a test enviroment with QEMU and buildroot. But I don't >>> know how to build the diskimage which same as linux-0.2.img offered by >>> BUILD-ROOT. I build the diskimage following the >>> buildroot-2009.05/docs/README.diskimage >>> , >>> but failure. >>> >>> The bellow is my process. >>> >>> # dd if=/dev/zero of=img bs=4096 count=16384 >>> # echo -e "n\np\n1\n\nw\n" | fdisk -C 16065 -H 255 -S 63 ./img >>> # losetup -o 512 /dev/loop0 img >> This looks like the wrong offset. The first partition usually starts at >> sector 63. > > I agree, perhaps Bai should instead use 32256. > > From "man losetup": > -o, --offset offset > The data start is moved offset bytes into the specified file or > device > > So it has to be converted into bytes. > > Bai, that could be the answer. Please kindly try it. You shouldn't have removed half of my answer. Using kpartx is so much easier than fiddling around with offsets. Kevin