I dd the MBR onto the new drive first (with the bootloader).<br>
Then use fdisk to create the partition (only modifies the partition tables). <br>Then mkfs.ext2 the new partition.<br>
Tar up the partition I want to copy.<br>
Untar it onto the new partition.<br>
Boot.<br>
<br>
HTH.<br>
<br><div><span class="gmail_quote">On 4/13/06, <b class="gmail_sendername">Daniel Carrera</b> <<a href="mailto:daniel.carrera@zmsl.com">daniel.carrera@zmsl.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br><br>I've been working more on getting disk images, and it's not very<br>straight forward. All the software available seems designed for data<br>recovery, whereas what I want to do is copy a disk image onto an<br>
entirely new disk.<br><br>First, the use scenario:<br>------------------------<br>An OEM wants to sell computers with Ubuntu Linux pre-installed. They<br>setup one computer with Ubuntu's OEM installation. Then they make an
<br>image of that computer's disk and put it on many computers to sell.<br><br>Attempted solutions:<br>--------------------<br>1) A first attempt was to use 'dd'.<br>dd if=/dev/hda of=oem_ubuntu.img<br><br>Then put that image on every other disk. This doesn't work because the
<br>other disks are not necessarily identical. In fact, they generally<br>aren't, they're just "similar". I tried this and the only part that<br>worked was the MBR. Even if this worked, we're talking about several
<br>hours of copy time because dd copies all the 0 bytes.<br><br>2) Next attempt is to use partimage.<br><br>Partimage actually understands the filesystem and makes an image of the<br>actual files inside a partition. This has the advantage that it can deal
<br>with different disk geometries and disk sizes. The problem now is that<br>partimage doesn't create partitions, and it doesn't copy the MBR, so the<br>machine won't boot.<br><br>3) Next attempt: a combination of dd and partimage
<br>Use dd to make an image of the MBR and partimage for the filesystem.<br><br>This is an improvement. But the MBR also includes partition information,<br>not just the bootloader. And the partition information may not be
<br>applicable (different disk geometry). Also, we still need to actually<br>create and format those partitions.<br><br>4) Next attempt:  ??????? (suggestions?)<br><br>I'm thinking that I might use fdisk to create the partitions. And
<br>perhaps use mke2fs too. But I still need a boot loader on the MBR. So<br>one option is:<br><br>* Use 'dd' to copy the bootloader.<br>* Then use fdisk to create/fix the partitions.<br><br>But this means that fdisk will have to fix a broken partition table. I
<br>don't know if that would work.<br><br>Another issue is that fdisk is an interactive program. I'd need a<br>non-interactive counterpart so I can write a script that automates all<br>of this.<br><br>If anyone has any ideas, please give a shout.
<br><br>Cheers,<br>Daniel.<br>--<br>      /\/`) <a href="http://opendocumentfellowship.org">http://opendocumentfellowship.org</a><br>     /\/_/<br>    /\/_/   A life? Sounds great!<br>    \/_/    Do you know where I could download one?
<br>    /<br><br>--<br>ubuntu-users mailing list<br><a href="mailto:ubuntu-users@lists.ubuntu.com">ubuntu-users@lists.ubuntu.com</a><br><a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-users">https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
</a><br></blockquote></div><br><br clear="all"><br>-- <br>Regards,<br>Russ