qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Mounting a disk image under Linux


From: Jim C. Brown
Subject: Re: [Qemu-devel] Mounting a disk image under Linux
Date: Sat, 19 Jun 2004 13:31:11 -0400
User-agent: Mutt/1.4i

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
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/qemu-devel

-- 
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]