[aklug] Re: stick together two partitions to get a bootable image

From: Christopher Howard <christopher.howard@frigidcode.com>
Date: Wed Jan 02 2013 - 12:00:41 AKST

On 01/01/2013 07:25 PM, Christopher Howard wrote:
> Hey guys. I created raw (block-level) copies of two partitions of a
> server (the boot partition and the root partition). I want to run them
> inside qemu, for purposes of testing, experimentation, and so forth.
> However, I think that I need to stick the partitions together first into
> a single bootable disk image. What would be the easiest way to go about
> that?
>

Progress report: I went with the most obvious approach: I created an new
raw image file of necessary size (actually slightly larger), then I
booted up qemu with a rescue cd, and the three images:

qemu-kvm -m 256 -cdrom bootcd.iso -hda wizard.img -hdb
wizard-boot-partition-20130101.img -hdd wizard-root-partition-20130101.img

Once inside the rescue cd environment, I partitioned sda to have two
partitions the appropriate size. Then I used dd to block level copy the
contents of sdb into sda1 and sdc into sda2. Then I installed grub onto sda.

Seems to have worked okay. Though, I have run into a few problems
because my kernel/initramfs configuration was for a different kind of
system setup than the one of have created in qemu. So I am in the
process of rebuilding the kernel and the initramfs.

-- 
frigidcode.com

---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.

Received on Wed Jan 2 11:53:07 2013

This archive was generated by hypermail 2.1.8 : Wed Jan 02 2013 - 11:53:07 AKST