qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] block device loopback
@ 2006-06-01 16:08 s[e]th & h[o]lth
  2006-06-01 16:31 ` Paul Brook
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: s[e]th & h[o]lth @ 2006-06-01 16:08 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1093 bytes --]

Hello,

I'm a qemu user and I'm looking for a way to use my virtual target drive
inside my host computer.
I've created a file that I'll call hda.disk like this : "dd if=/dev/zer of=
hda.disk count=1 bs=1M seek=1023" and i use it like "qemu -hda hda.disk"
The problem i meet is that i can't use this file outside the virtual machine
and I'm trying to program a block device driver to read this file as a IDE
drive.
The aim of this driver is quite similar to the loop driver but instead of
"emulating" a partition, it emulates a IDE Hard Drive and give an access to
it via /dev/vdX and it's partition via /dev/vdXpY.
Perhaps you will wonder why i use the qemu's mailing-list for this problem :
- i don't know exactly where i can find a way to achieve this project ;
- i wonder how you read your hda.disk without using qemu ;
- i would like to know how qemu fix the virtual drive property inside the
virtual machine (cylinders, sectors, etc...) ;
- i don't know anyone interested by this problem and quite good enough linux
driver developer to help me.

Thank you very much and have a nice day !

[-- Attachment #2: Type: text/html, Size: 2214 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] block device loopback
  2006-06-01 16:08 [Qemu-devel] block device loopback s[e]th & h[o]lth
@ 2006-06-01 16:31 ` Paul Brook
  2006-06-01 16:50 ` Jim C. Brown
  2006-06-02 13:52 ` NyOS
  2 siblings, 0 replies; 4+ messages in thread
From: Paul Brook @ 2006-06-01 16:31 UTC (permalink / raw)
  To: qemu-devel

> The aim of this driver is quite similar to the loop driver but instead of
> "emulating" a partition, it emulates a IDE Hard Drive and give an access to
> it via /dev/vdX and it's partition via /dev/vdXpY.
> Perhaps you will wonder why i use the qemu's mailing-list for this problem
> : - i don't know exactly where i can find a way to achieve this project ; -
> i wonder how you read your hda.disk without using qemu ;

I'd be surprised if this problem wasn't already fixed by the kernel 
device-mapper infrastructure.

I also think this list is the wrong place to discuss this. There's nothing 
qemu specific about it.

> - i would like to know how qemu fix the virtual drive property inside the
> virtual machine (cylinders, sectors, etc...) ;

qemu doesn't know or care about the contents of the image. It's entirely up to 
the guest OS.

Paul

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] block device loopback
  2006-06-01 16:08 [Qemu-devel] block device loopback s[e]th & h[o]lth
  2006-06-01 16:31 ` Paul Brook
@ 2006-06-01 16:50 ` Jim C. Brown
  2006-06-02 13:52 ` NyOS
  2 siblings, 0 replies; 4+ messages in thread
From: Jim C. Brown @ 2006-06-01 16:50 UTC (permalink / raw)
  To: qemu-devel

I'm working on something that does just this. I'm calling it vda (its based
on lomount), and it provides access to vda, vda1, vda2, etc.

I don't see why you are unable to use the disk image as is though. lomount and
similar tools should be able to handle the job quite easily.

On Thu, Jun 01, 2006 at 06:08:56PM +0200, s[e]th & h[o]lth wrote:
> Hello,
> 
> I'm a qemu user and I'm looking for a way to use my virtual target drive
> inside my host computer.
> I've created a file that I'll call hda.disk like this : "dd if=/dev/zer of=
> hda.disk count=1 bs=1M seek=1023" and i use it like "qemu -hda hda.disk"
> The problem i meet is that i can't use this file outside the virtual machine
> and I'm trying to program a block device driver to read this file as a IDE
> drive.
> The aim of this driver is quite similar to the loop driver but instead of
> "emulating" a partition, it emulates a IDE Hard Drive and give an access to
> it via /dev/vdX and it's partition via /dev/vdXpY.
> Perhaps you will wonder why i use the qemu's mailing-list for this problem :
> - i don't know exactly where i can find a way to achieve this project ;
> - i wonder how you read your hda.disk without using qemu ;
> - i would like to know how qemu fix the virtual drive property inside the
> virtual machine (cylinders, sectors, etc...) ;
> - i don't know anyone interested by this problem and quite good enough linux
> driver developer to help me.
> 
> Thank you very much and have a nice day !

> _______________________________________________
> 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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] block device loopback
  2006-06-01 16:08 [Qemu-devel] block device loopback s[e]th & h[o]lth
  2006-06-01 16:31 ` Paul Brook
  2006-06-01 16:50 ` Jim C. Brown
@ 2006-06-02 13:52 ` NyOS
  2 siblings, 0 replies; 4+ messages in thread
From: NyOS @ 2006-06-02 13:52 UTC (permalink / raw)
  To: qemu-devel

On Thu, 01 Jun 2006 18:08:56 +0200, s[e]th & h[o]lth  
<seth.holth@gmail.com> wrote:

> Hello,
>
> I'm a qemu user and I'm looking for a way to use my virtual target drive
> inside my host computer.
> I've created a file that I'll call hda.disk like this : "dd if=/dev/zer  
> of=
> hda.disk count=1 bs=1M seek=1023" and i use it like "qemu -hda hda.disk"
> The problem i meet is that i can't use this file outside the virtual  
> machine
> and I'm trying to program a block device driver to read this file as a  
> IDE
> drive.
> The aim of this driver is quite similar to the loop driver but instead of
> "emulating" a partition, it emulates a IDE Hard Drive and give an access  
> to
> it via /dev/vdX and it's partition via /dev/vdXpY.
> Perhaps you will wonder why i use the qemu's mailing-list for this  
> problem :
> - i don't know exactly where i can find a way to achieve this project ;
> - i wonder how you read your hda.disk without using qemu ;
> - i would like to know how qemu fix the virtual drive property inside the
> virtual machine (cylinders, sectors, etc...) ;
> - i don't know anyone interested by this problem and quite good enough  
> linux
> driver developer to help me.
>
> Thank you very much and have a nice day !

Hi!

how many partitions do you have on that virtual disc image? maybe 1 is  
enough in most cases..
once i've read on a forum the next 'trick':

nyos@nyos:~$ /sbin/fdisk $HOME/image/qemu-win98.img
You must set cylinders.
You can do this from the extra functions menu.

Command (m for help): p

Disk /home/nyos/image/qemu-win98.img: 0 MB, 0 bytes
128 heads, 63 sectors/track, 0 cylinders
Units = cylinders of 8064 * 512 = 4128768 bytes

                           Device Boot      Start         End      Blocks    
Id  System
/home/nyos/image/qemu-win98.img1   *           1         520      
2096608+   c  W95 FAT32 (LBA)
Partition 1 has different physical/logical endings:
      phys=(518, 127, 63) logical=(519, 127, 63)

Command (m for help): q

so, there are 63 sectors/track, one track is 512 bytes long, and the 1st  
partition starts at 1th track
63*512*1=32256

so the following command:
sudo mount $HOME/image/qemu-win98.img $HOME/win98loop -o loop,offset=32256  
-t vfat
will mount the 1st partition in that image into the apropriate directory  
by ignoring the first 32256 bytes of the image leaving only the partition  
in it..

hope it helps

------------------------------------------------------------
Light thinks it travels faster than anything but it is wrong. No matter  
how fast light travels it finds the darkness has always got there first,  
and is waiting for it. - Terry Pratchett

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-06-02 14:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-01 16:08 [Qemu-devel] block device loopback s[e]th & h[o]lth
2006-06-01 16:31 ` Paul Brook
2006-06-01 16:50 ` Jim C. Brown
2006-06-02 13:52 ` NyOS

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).