qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Stupid question?
@ 2004-09-05 12:11 Dieter Schicker
  2004-09-05 12:15 ` Hetz Ben Hamo
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Dieter Schicker @ 2004-09-05 12:11 UTC (permalink / raw)
  To: qemu-devel


Hello,

I installed qemu on Debian Linux and then installed win98 into a virtual
harddisk file. Everything works fine, there's only one question:

How can I mount the "virtual harddisk file" in Linux?
mount -t vfat -o loop /data/win98.img /mnt/win   fails!

Any suggestions?

Thanks in advance
Didi

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

* Re: [Qemu-devel] Stupid question?
  2004-09-05 12:11 Dieter Schicker
@ 2004-09-05 12:15 ` Hetz Ben Hamo
  2004-09-05 12:41 ` Johannes Martin
  2004-09-06  7:56 ` Marcello 'R.D.O.' Magnifico
  2 siblings, 0 replies; 13+ messages in thread
From: Hetz Ben Hamo @ 2004-09-05 12:15 UTC (permalink / raw)
  To: qemu-devel; +Cc: Dieter Schicker

On Sunday 05 September 2004 03:11 pm, Dieter Schicker wrote:
> Hello,
>
> I installed qemu on Debian Linux and then installed win98 into a virtual
> harddisk file. Everything works fine, there's only one question:
>
> How can I mount the "virtual harddisk file" in Linux?
> mount -t vfat -o loop /data/win98.img /mnt/win   fails!
>
> Any suggestions?
>

Yes,

Use this lomount utility from my web site:  
http://www.dad-answers.com/qemu/utilities/QEMU-HD-Mounter/

Compile, install, use ;)

Thanks,
Hetz

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

* Re: [Qemu-devel] Stupid question?
  2004-09-05 12:11 Dieter Schicker
  2004-09-05 12:15 ` Hetz Ben Hamo
@ 2004-09-05 12:41 ` Johannes Martin
  2004-09-05 13:43   ` Jim C. Brown
  2004-09-06  7:56 ` Marcello 'R.D.O.' Magnifico
  2 siblings, 1 reply; 13+ messages in thread
From: Johannes Martin @ 2004-09-05 12:41 UTC (permalink / raw)
  To: qemu-devel

Hi,

On Sun, 5 Sep 2004, Dieter Schicker wrote:
> How can I mount the "virtual harddisk file" in Linux?
> mount -t vfat -o loop /data/win98.img /mnt/win   fails!
>
> Any suggestions?
Hetz already told us how to do this in his last email...

As to 'why' the above doesn't work: I assume it's because mount expects a
hard disk partition while /data/win98.img is a complete disk (including
the master boot record, partition table, etc), i.e. about 64 extra sectors
at the beginning (depending on disk geometry). Right?

BTW, has anybody worked on making it possible to mount 'cow' images on the
host?

	Johannes

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

* Re: [Qemu-devel] Stupid question?
  2004-09-05 12:41 ` Johannes Martin
@ 2004-09-05 13:43   ` Jim C. Brown
  2004-09-05 14:05     ` Tim
  0 siblings, 1 reply; 13+ messages in thread
From: Jim C. Brown @ 2004-09-05 13:43 UTC (permalink / raw)
  To: qemu-devel

On Sun, Sep 05, 2004 at 02:41:24PM +0200, Johannes Martin wrote:
> Hi,
> 
> On Sun, 5 Sep 2004, Dieter Schicker wrote:
> > How can I mount the "virtual harddisk file" in Linux?
> > mount -t vfat -o loop /data/win98.img /mnt/win   fails!
> >
> > Any suggestions?
> Hetz already told us how to do this in his last email...
> 
> As to 'why' the above doesn't work: I assume it's because mount expects a
> hard disk partition while /data/win98.img is a complete disk (including
> the master boot record, partition table, etc), i.e. about 64 extra sectors
> at the beginning (depending on disk geometry). Right?
> 

Right. lomount gets around this by passing the offset= option to mount
(which passes it to losetup). You don't need lomount for this, you can
calculate the offset yourself. If you want to.

> BTW, has anybody worked on making it possible to mount 'cow' images on the
> host?

Sparse images should work fine w/ lomount. qemu cow images will never work,
and to use those you'd have to convert them to a regular image first.

(I lied above. There is one way to make them work, but it is fairly contorted
and twisted and not at all trivial. It'd be a massive project in itself ...
bsaicly you'd need to write a daemon that pretended to be a user-space NFS
server, and have it read/write to the cow image on the kernel's behalf. This is
extra hard because it would have to know what a FAT/NTFS/ext2/etc file system
looks like in a cow image. Easier just to convert the cow into a regular image
and use that.)

> 
> 	Johannes
> 
> 
> 
> _______________________________________________
> 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] 13+ messages in thread

* Re: [Qemu-devel] Stupid question?
  2004-09-05 13:43   ` Jim C. Brown
@ 2004-09-05 14:05     ` Tim
  0 siblings, 0 replies; 13+ messages in thread
From: Tim @ 2004-09-05 14:05 UTC (permalink / raw)
  To: qemu-devel

> (I lied above. There is one way to make them work, but it is fairly contorted
> and twisted and not at all trivial. It'd be a massive project in itself ...
> bsaicly you'd need to write a daemon that pretended to be a user-space NFS
> server, and have it read/write to the cow image on the kernel's behalf. This is
> extra hard because it would have to know what a FAT/NTFS/ext2/etc file system
> looks like in a cow image. Easier just to convert the cow into a regular image
> and use that.)

Actually, an easier method might be to write a daemon that acts like a
network block device that Linux supports, then read from it.  The daemon
wouldn't have to know anything about the filesystem.  I don't think
network block devices are very cross-platform, but if you really needed
to do it, it might be an option.

tim

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

* Re: [Qemu-devel] Stupid question?
  2004-09-05 12:11 Dieter Schicker
  2004-09-05 12:15 ` Hetz Ben Hamo
  2004-09-05 12:41 ` Johannes Martin
@ 2004-09-06  7:56 ` Marcello 'R.D.O.' Magnifico
  2004-09-06  8:03   ` Dieter Schicker
  2 siblings, 1 reply; 13+ messages in thread
From: Marcello 'R.D.O.' Magnifico @ 2004-09-06  7:56 UTC (permalink / raw)
  To: qemu-devel

> How can I mount the "virtual harddisk file" in Linux?
> mount -t vfat -o loop /data/win98.img /mnt/win   fails!
> 
> Any suggestions?

If you plan to access just FAT volumes, Mtools are good for this  
purpose: you can create a unit letter in the /etc/mtools.conf and tell  
Mtools to use just a partition (partition=1 or such). I do that since I  
first tried Bochs. Unsure about Debian, but I found sample entries in  
the mtools.conf itself under RH.


	yo,
	RDO

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

* Re: [Qemu-devel] Stupid question?
  2004-09-06  7:56 ` Marcello 'R.D.O.' Magnifico
@ 2004-09-06  8:03   ` Dieter Schicker
  0 siblings, 0 replies; 13+ messages in thread
From: Dieter Schicker @ 2004-09-06  8:03 UTC (permalink / raw)
  To: qemu-devel


Thanks! I'll give mtools a try, although lomount works perfect for me
(Debian Sarge + Win98).

Cheers
Dieter


On Mon, 6 Sep 2004, Marcello 'R.D.O.' Magnifico wrote:

> > How can I mount the "virtual harddisk file" in Linux?
> > mount -t vfat -o loop /data/win98.img /mnt/win   fails!
> >
> > Any suggestions?
>
> If you plan to access just FAT volumes, Mtools are good for this
> purpose: you can create a unit letter in the /etc/mtools.conf and tell
> Mtools to use just a partition (partition=1 or such). I do that since I
> first tried Bochs. Unsure about Debian, but I found sample entries in
> the mtools.conf itself under RH.
>
>
> 	yo,
> 	RDO
>
>
>
>
>
> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/qemu-devel
>

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

* [Qemu-devel] Stupid question?
@ 2011-02-26 22:15 Frans de Boer
  2011-02-26 22:22 ` Dushyant Bansal
  0 siblings, 1 reply; 13+ messages in thread
From: Frans de Boer @ 2011-02-26 22:15 UTC (permalink / raw)
  To: qemu-devel

Hi all,

This is the only QEMU list, so I put my question her.
How can I copy the contents of a "*.raw" image to a real HD partition or 
vice versa.
I often use a virtual image using qemu/kvm to test some OS's and want to 
migrate them to a HD partition if the time is right. Also, I like to 
preserve old partitions for future use/reference.

Any suggestions?

Regards, Frans.

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

* Re: [Qemu-devel] Stupid question?
  2011-02-26 22:15 [Qemu-devel] Stupid question? Frans de Boer
@ 2011-02-26 22:22 ` Dushyant Bansal
  2011-02-26 22:33   ` Frans de Boer
  2011-02-27  6:22   ` Amos Kong
  0 siblings, 2 replies; 13+ messages in thread
From: Dushyant Bansal @ 2011-02-26 22:22 UTC (permalink / raw)
  To: Frans de Boer; +Cc: qemu-devel

On Sunday 27 February 2011 03:45 AM, Frans de Boer wrote:
> Hi all,
>
> This is the only QEMU list, so I put my question her.
> How can I copy the contents of a "*.raw" image to a real HD partition 
> or vice versa.
> I often use a virtual image using qemu/kvm to test some OS's and want 
> to migrate them to a HD partition if the time is right. Also, I like 
> to preserve old partitions for future use/reference.
>
> Any suggestions?
>
> Regards, Frans.
>
You can mount it using losetup.
http://blog.piotrj.org/2009/03/mounting-raw-kvmqemu-image.html

Thanks,
Dushyant

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

* Re: [Qemu-devel] Stupid question?
  2011-02-26 22:22 ` Dushyant Bansal
@ 2011-02-26 22:33   ` Frans de Boer
  2011-02-27  6:22   ` Amos Kong
  1 sibling, 0 replies; 13+ messages in thread
From: Frans de Boer @ 2011-02-26 22:33 UTC (permalink / raw)
  To: qemu-devel

On 02/26/2011 11:22 PM, Dushyant Bansal wrote:
> On Sunday 27 February 2011 03:45 AM, Frans de Boer wrote:
>> Hi all,
>>
>> This is the only QEMU list, so I put my question her.
>> How can I copy the contents of a "*.raw" image to a real HD partition 
>> or vice versa.
>> I often use a virtual image using qemu/kvm to test some OS's and want 
>> to migrate them to a HD partition if the time is right. Also, I like 
>> to preserve old partitions for future use/reference.
>>
>> Any suggestions?
>>
>> Regards, Frans.
>>
> You can mount it using losetup.
> http://blog.piotrj.org/2009/03/mounting-raw-kvmqemu-image.html
>
> Thanks,
> Dushyant
>
Thanks, that seems a good way to start. Sorry for the obvious, but Linux 
has so many options/features, I sometimes use the lazy way to get answers.

Regards, Frans.

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

* Re: [Qemu-devel] Stupid question?
  2011-02-26 22:22 ` Dushyant Bansal
  2011-02-26 22:33   ` Frans de Boer
@ 2011-02-27  6:22   ` Amos Kong
  2011-02-27 16:15     ` Avi Kivity
  2011-02-27 17:00     ` Stefan Hajnoczi
  1 sibling, 2 replies; 13+ messages in thread
From: Amos Kong @ 2011-02-27  6:22 UTC (permalink / raw)
  To: Dushyant Bansal; +Cc: Frans de Boer, qemu-devel

On Sun, Feb 27, 2011 at 6:22 AM, Dushyant Bansal
<cs5070214@cse.iitd.ac.in> wrote:
> On Sunday 27 February 2011 03:45 AM, Frans de Boer wrote:
>>
>> Hi all,
>>
>> This is the only QEMU list, so I put my question her.
>> How can I copy the contents of a "*.raw" image to a real HD partition or
>> vice versa.
>> I often use a virtual image using qemu/kvm to test some OS's and want to
>> migrate them to a HD partition if the time is right. Also, I like to
>> preserve old partitions for future use/reference.
>>
>> Any suggestions?
>>
>> Regards, Frans.
>>
> You can mount it using losetup.
> http://blog.piotrj.org/2009/03/mounting-raw-kvmqemu-image.html

losetup is fine, can we directly use dd ?

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

* Re: [Qemu-devel] Stupid question?
  2011-02-27  6:22   ` Amos Kong
@ 2011-02-27 16:15     ` Avi Kivity
  2011-02-27 17:00     ` Stefan Hajnoczi
  1 sibling, 0 replies; 13+ messages in thread
From: Avi Kivity @ 2011-02-27 16:15 UTC (permalink / raw)
  To: Amos Kong; +Cc: Frans de Boer, Dushyant Bansal, qemu-devel

On 02/27/2011 08:22 AM, Amos Kong wrote:
> On Sun, Feb 27, 2011 at 6:22 AM, Dushyant Bansal
> <cs5070214@cse.iitd.ac.in>  wrote:
> >  On Sunday 27 February 2011 03:45 AM, Frans de Boer wrote:
> >>
> >>  Hi all,
> >>
> >>  This is the only QEMU list, so I put my question her.
> >>  How can I copy the contents of a "*.raw" image to a real HD partition or
> >>  vice versa.
> >>  I often use a virtual image using qemu/kvm to test some OS's and want to
> >>  migrate them to a HD partition if the time is right. Also, I like to
> >>  preserve old partitions for future use/reference.
> >>
> >>  Any suggestions?
> >>
> >>  Regards, Frans.
> >>
> >  You can mount it using losetup.
> >  http://blog.piotrj.org/2009/03/mounting-raw-kvmqemu-image.html
>
> losetup is fine, can we directly use dd ?
>

dd words for a raw file; qemu-img works for all qemu supported formats.

-- 
error compiling committee.c: too many arguments to function

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

* Re: [Qemu-devel] Stupid question?
  2011-02-27  6:22   ` Amos Kong
  2011-02-27 16:15     ` Avi Kivity
@ 2011-02-27 17:00     ` Stefan Hajnoczi
  1 sibling, 0 replies; 13+ messages in thread
From: Stefan Hajnoczi @ 2011-02-27 17:00 UTC (permalink / raw)
  To: Amos Kong; +Cc: Frans de Boer, Dushyant Bansal, qemu-devel

kpartx is easier than losetup for getting at individual partitions
inside a raw image.

http://linux.die.net/man/8/kpartx

Stefan

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

end of thread, other threads:[~2011-02-27 17:00 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-26 22:15 [Qemu-devel] Stupid question? Frans de Boer
2011-02-26 22:22 ` Dushyant Bansal
2011-02-26 22:33   ` Frans de Boer
2011-02-27  6:22   ` Amos Kong
2011-02-27 16:15     ` Avi Kivity
2011-02-27 17:00     ` Stefan Hajnoczi
  -- strict thread matches above, loose matches on Subject: below --
2004-09-05 12:11 Dieter Schicker
2004-09-05 12:15 ` Hetz Ben Hamo
2004-09-05 12:41 ` Johannes Martin
2004-09-05 13:43   ` Jim C. Brown
2004-09-05 14:05     ` Tim
2004-09-06  7:56 ` Marcello 'R.D.O.' Magnifico
2004-09-06  8:03   ` Dieter Schicker

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