From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1Bbl8x-0004Hq-Qw for qemu-devel@nongnu.org; Sat, 19 Jun 2004 15:04:47 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Bbl8w-0004HV-6U for qemu-devel@nongnu.org; Sat, 19 Jun 2004 15:04:47 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bbl8w-0004HS-33 for qemu-devel@nongnu.org; Sat, 19 Jun 2004 15:04:46 -0400 Received: from [38.113.3.61] (helo=babyruth.hotpop.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Bbl7U-0003kt-1y for qemu-devel@nongnu.org; Sat, 19 Jun 2004 15:03:16 -0400 Received: from phreaker.net (kubrick.hotpop.com [38.113.3.103]) by babyruth.hotpop.com (Postfix) with SMTP id 52AA06211E2 for ; Sat, 19 Jun 2004 18:24:25 +0000 (UTC) Received: from jbrown.mylinuxbox.org (pcp03144805pcs.midval01.tn.comcast.net [68.59.228.236]) by smtp-1.hotpop.com (Postfix) with ESMTP id 27B8D1A5277 for ; Sat, 19 Jun 2004 16:32:29 +0000 (UTC) Date: Sat, 19 Jun 2004 13:31:11 -0400 From: "Jim C. Brown" Subject: Re: [Qemu-devel] Mounting a disk image under Linux Message-ID: <20040619173111.GB11948@jbrown.mylinuxbox.org> References: <1087396951.40d05c57252a0@www.raysa.org> <40D0AD00.7050207@silentsoftware.co.uk> <40D0B569.8070204@bellard.org> <40D0BE89.4070904@silentsoftware.co.uk> <40D46B1B.9070704@silentsoftware.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40D46B1B.9070704@silentsoftware.co.uk> Reply-To: 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 Sat, Jun 19, 2004 at 05:34:35PM +0100, Benjamin Brown wrote: > I created a disk image under (host) Linux using dd and fdisked and > formatted using a (guest)Windows 98 boot disk under QEMU. > I then tried to mount this under linux to add files to it using: > > mount -o loop /opt/qemu/tempImage /mnt/tempImage > > This failed and asked me for the filesystem type so I specified: > > mount -o loop -t vfat /opt/qemu/tempImage /mnt/tempImage > > This also failed with the error: > > mount: wrong fs type, bad option, bad superblock on /dev/loop1, > or too many mounted file systems > (could this be the IDE device where you in fact use > ide-scsi so that sr0 or sda or so is needed?) > > Any ideas why this happens - this should just a straight fat formatted > disk image? > > No its not. There is a partition table in it. The quick and dirty way is to use this mount command: mount -oloop,offset=sector_size*partition_start -t vfat /opt/qemu/tempImage /mnt/tempImage sector_size is usually 512 and parition_start is usually 63. You can run fdisk -lu /opt/qemu/tempImage to be sure. I'm working on a wrapper called lomount that does this for you. Basicly you call it like this: lomount -t vfat -diskimage /opt/qemu/tempImage -partition 1 /mnt/tempImage It works great but has a bug if you try to mount a partition which doesnt exist. > > _______________________________________________ > Qemu-devel mailing list > Qemu-devel@nongnu.org > http://lists.nongnu.org/mailman/listinfo/qemu-devel -- Infinite complexity begets infinite beauty. Infinite precision begets infinite perfection.