qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Booting a partition image (not a disk image)?


From: Jim C. Brown
Subject: Re: [Qemu-devel] Booting a partition image (not a disk image)?
Date: Sun, 13 Nov 2005 12:27:14 -0500
User-agent: Mutt/1.4.2.1i

On Sun, Nov 13, 2005 at 04:31:45PM +0000, Richard Neill wrote:
> Dear All,
> 
> I hope this isn't a stupid question, but I can't find the answer to it 
> anywhere.  I have copied across the windows ME partition from an old 
> machine, using
>  dd if=/dev/hda2 | ssh address@hidden "cat > hda2.img"
> This has worked, and I can mount the filesystem fine.
> 
> Is there any way I can boot this image using QEMU? i.e. there is no boot 
>  sector, and I've not copied the rest of the drive to save space.
> 
> The obvious solution doesn't work:
>  qemu -boot c -snapshot -hda hda2.img
> 
> Thanks very much,
> 
> Richard
> 

You need a boot sector in order to be able to boot the image.

Anyways, qemu requires a full hard disk image (MBR, partition table, etc) to
be able to boot a disk image. If you must boot with hda2.img instead of a full
hard disk image, there may be a way to work around that. (To be safe, I'd
recommend making a copy of hda2.img first as a backup.)

You can dump out the MBR & partition table (first few sectors of the hard disk)
into a file, and then append hda2.img to that file. Then load the image up in
fdisk to "fix" the partition table (removing all the other partitions and
giving the single partition the right start and end numbers). After that, things
should work fine.

This is complicated, and may take a while to get right if you are new to
playing with hard disk images.

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




reply via email to

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