From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MfqSi-0002D5-8C for qemu-devel@nongnu.org; Tue, 25 Aug 2009 03:29:00 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MfqSd-00026H-JE for qemu-devel@nongnu.org; Tue, 25 Aug 2009 03:28:59 -0400 Received: from [199.232.76.173] (port=40792 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MfqSc-00026B-G6 for qemu-devel@nongnu.org; Tue, 25 Aug 2009 03:28:54 -0400 Received: from moutng.kundenserver.de ([212.227.17.8]:49995) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MfqSc-0003FY-0P for qemu-devel@nongnu.org; Tue, 25 Aug 2009 03:28:54 -0400 Subject: Re: [Qemu-devel] diskimage HOWTO From: Laurent Vivier In-Reply-To: <4A9245EA.9030108@redhat.com> References: <4A9245EA.9030108@redhat.com> Content-Type: text/plain; charset=utf-8 Date: Tue, 25 Aug 2009 09:28:47 +0200 Message-Id: <1251185327.5886.4.camel@Quad> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: buildroot@busybox.net, qemu-devel@nongnu.org, Bai Shuwei Le lundi 24 ao=C3=BBt 2009 =C3=A0 09:48 +0200, Kevin Wolf a =C3=A9crit : > 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=20 > > buildroot-2009.05/docs/README.diskimage > > , > > but failure. > > =20 > > The bellow is my process. > > =20 > > # dd if=3D/dev/zero of=3Dimg bs=3D4096 count=3D16384 > > # echo -e "n\np\n1\n\nw\n" | fdisk -C 16065 -H 255 -S 63 ./img > > # losetup -o 512 /dev/loop0 img >=20 > This looks like the wrong offset. The first partition usually starts at > sector 63. But probably you'll want to use kpartx which takes an image > and creates device nodes for each partition. You can also use loop module with max_part parameter (on a recent kernel, 2.6.26, I think): # rmmod loop # modprobe loop max_part=3D16 # losetup -f /dev/loop0 # mount /dev/loop0p1 /mnt If the disk image format is qcow2 you can use nbd module with max_part parameter and qemu-nbd. Regards, Laurent --=20 --------------------- laurent@vivier.eu ---------------------- "Tout ce qui est impossible reste =C3=A0 accomplir" Jules Verne "Things are only impossible until they're not" Jean-Luc Picard