From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JQHk0-0006cu-LI for qemu-devel@nongnu.org; Sat, 16 Feb 2008 02:45:44 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JQHjy-0006cd-3h for qemu-devel@nongnu.org; Sat, 16 Feb 2008 02:45:43 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JQHjx-0006ca-TN for qemu-devel@nongnu.org; Sat, 16 Feb 2008 02:45:41 -0500 Received: from mx20.gnu.org ([199.232.41.8]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from <10walls@gmail.com>) id 1JQHjx-0005BQ-DI for qemu-devel@nongnu.org; Sat, 16 Feb 2008 02:45:41 -0500 Received: from rv-out-0910.google.com ([209.85.198.185]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from <10walls@gmail.com>) id 1JQHjw-0005pA-Ce for qemu-devel@nongnu.org; Sat, 16 Feb 2008 02:45:40 -0500 Received: by rv-out-0910.google.com with SMTP id g11so2387228rvb.22 for ; Fri, 15 Feb 2008 23:45:38 -0800 (PST) Message-ID: <47B6944F.1010303@gmail.com> Date: Sat, 16 Feb 2008 15:44:15 +0800 From: JonY <10walls@gmail.com> MIME-Version: 1.0 Subject: Re: [Qemu-devel] How to extract content of a raw image on host? References: <47B683F0.3050109@googlemail.com> <47B6858E.3020008@gmail.com> <47B68E49.7020906@googlemail.com> In-Reply-To: <47B68E49.7020906@googlemail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dirk Behme Cc: qemu-devel@nongnu.org Dirk Behme wrote: > JonY wrote: >> Dirk Behme wrote: >> >>> Hi, >>> >>> is there a way to extract the contents of a qemu raw image on (x86 >>> Linux) host without starting QEMU itself? If so, any hint would be >>> quite nice. >>> >>> I'm looking for anything like the reverse what >>> >>> http://lists.gnu.org/archive/html/qemu-devel/2006-04/msg00448.html >>> >>> seems to do. Extract files/directories from an existing raw image. >>> >>> qemu-img reports me >>> >>> > qemu-img info disk.img >>> image: disk.img >>> file format: raw >>> virtual size: 4.3M (4515328 bytes) >>> disk size: 4.3M >>> >>> but what is in it and how to access the content? >>> >>> Thanks, and sorry if this is a FAQ and I missed the correct search >>> string, >>> >>> Dirk >>> >> Hi, >> >> have you tried using a loop back mount? > > # mount -o loop disk.img mnt/ > mount: You have to specify a file system type > # mount -t raw -o loop disk.img mnt/ > mount: unknown file system type „raw“ > > Sorry if I miss the obvious ;) > > Dirk > > Hi, "raw" is not really a file system, its just a way of saying the image has a "exact copy of every bit" of what a physical disk would have. Try, "mount -o loop disk.img mnt/", mount might be able to determine the correct file system. If it is a hard disk image with partition tables, try opening it with fdisk to confirm so. List down the partitions. Note the offsets Try something like "mount -o loop,offset=32256 disk.img mnt/" see here for more details: http://howto.wikia.com/wiki/How_to_see_the_content_of_a_Qemu_image_on_a_linux-based_OS