qemu-discuss
[Top][All Lists]
Advanced

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

Re: [Qemu-discuss] raw image to bootable hard disk


From: Dwight Schauer
Subject: Re: [Qemu-discuss] raw image to bootable hard disk
Date: Fri, 25 Nov 2011 13:04:23 -0600

> On 25 November 2011 12:40, Tim Fletcher <address@hidden> wrote:
>> On Tue, 2011-11-22 at 16:07 -0500, Dennis chua wrote:
>>> Is there a way to transfer a qemu raw image file to a boot drive of a
>>> physical machine?
>> Unless I am really misunderstanding the problem can't you just dd the
>> raw image on to the physical drive?

That is exactly what needs to be done.
Raw image == disk image on a partition or entire disk (there is no difference)

block sizes don't matter, dd figures it out. If you don't give a
count, you can give any block size, it will all get copied. You seem
to have figured it out,, so the following may not matter for you, but
would matter for those who need to do the same thing and have a target
partition that is a different size from the raw image file.

On Fri, Nov 25, 2011 at 11:40 AM, Ottavio <address@hidden> wrote:
> For safety I'd mount the image on Unix host, then `dd`  the mounted
> directory on the target drive.

That makes no sense at all. You can't dd a directory. You can only dd
files and block devices. Even if you could get a dd of a directory to
work (the actual directory file on some *nixes) it would not give you
the result you wanted.

And you don't want to dd a mounted image (if it mounted rw) as the
result will likely be corrupted.

Unless you meant the following, which does make sense, if there is a
different in sizes between the image and partition:

1) format the target partition
2) mount the raw image
3) mount the target partion
4) copy over all the files (tar - | tar -, rsync -av, cp -av, or some
other equivalent method)
5) unmount the raw image
6) unmount the target partition

That would be one method if the the target partition was smaller than
the disk image.
Other would be to resize the raw image first to the minimum size. If
the new size was smaller then the target partition, you would then dd
it over, then resize the target partition file-system image to the
maximum size.



reply via email to

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