Disk images

Daniel Carrera daniel.carrera at zmsl.com
Thu Apr 13 21:17:28 UTC 2006

Gary W. Swearingen wrote:
>>* Use 'dd' to copy the bootloader.
> Remember that the bootloader(s) are not all in the MBR.

I didn't know that. But surely this should work:

dd if=/dev/hda of=/dev/hdb count=1 bs=446 # copy boot loader in MBR
mount /dev/hda /mnt/source && mount /dev/hdb /mnt/dest
cp --archive /mnt/source/* /mnt/dest/

What am I missing?

> Seems problematical.  And it sounds like you didn't give my previous
> message enough attention.  Maybe I was unclear.

Perhaps I didn't understand...

> I gather from a very quick look at the "parted" manpage that it can be
> used non-interactively (instead of "fdisk") and can even be used to
> create filesystems (though it mentions ext2 but not ext3).

Ok. I'm sure that parted

> Anyway, maybe try this:
> Boot the "new" PC off some CD and run a script which does this:
>    1) zero first hd track, at least (probably unnecessary)
>       dd if=/dev/zero of=/dev/hda bs=16k count=1

The first *track*? Why that much? That would include much more than the 
MBR. Plus, it would include the partition table. What am I missing?

I'm willing to try anything you suggest. I'd just like to understand the 

>    2) partition the hd (with "parted")
>    3) make filesystem(s) (with "parted", "mkfs", or whatever)
>    4) connect to OEM server and "untar" files into filesystem(s).

Ok. I'm sure this part can work.

>    5) Run bootloader creation software like grub or lilo.

Could you expand on this bit? I thought grub didn't need an additional 
step (unlike lilo). With grub you just edit the .conf file and you're set.

> On a BSD OS, you'd avoid the historically problematical (and I suspect
> slower) "tar" and use "dump" and "restore", which probably have Linux
> versions, but tar should do the job.

I didn't know that dump was better than tar. I've always used tar.

> You might be able to fit a copy of the tarball on the CD and avoid
> the network bit.  And make the script run at boot.  Or use a second
> CD.

I could burn it onto a DVD and then it'd definitely fit.

> I've never done this.

This has been an interesting learning experience.

      /\/`) http://opendocumentfellowship.org
    /\/_/   A life? Sounds great!
    \/_/    Do you know where I could download one?

More information about the ubuntu-users mailing list