[ltp] Cloning a hard disk?

Andrew Crawford linux-thinkpad@linux-thinkpad.org
Thu, 18 Aug 2005 10:39:50 -0700


Another option might be to copy the partitions (including the Windows
restore partition) with something like (the open source, free) Partition
Image ( http://www.partimage.org ) and save the master boot record and
partitioning information separately.

I use a linux Live CD distro, such as the System Rescue CD (
http://www.sysresccd.org ) to boot a system.  You can use another system
running the server version of Partition Image and transfer and image
across the network as it is created (with optional SSH tunneling).  It
can also save to another local drive (connected by USB, perhaps).

For reference, to save the MBR:

   dd if=/dev/hda of=backup-hda.mbr bs=512 count=1

... and to save the extended partition information, use sfdisk:

   sfdisk -d /dev/hda > backup-hda.sf

Save the resulting two files somewhere and you will be able to quickly
re-create the drive's partitioning.

This might be more convenient since you will have a compressed image
that is more easily stored.  It may also give you some more flexibility
in the event your hardware or needs change in the future.

Andrew Crawford

Jaime Iniesta wrote:
> Do you think this would work if instead of mounting the new HD on
> another machine, I've got it mounted by USB on the Thinkpad?
> 
> I mean, boot the Thinkpad with a Knoppixx CD and 'dd' the /dev/hda to
> /media/usb or whatever is called the new HD.
> 
> I want to clone the *entire* HD, not just a partition, to keep the
> hidden Windows recovery partition.
> 
> Jaime
> 
> 
> 2005/8/18, Richard Neill <rn214@hermes.cam.ac.uk
> <mailto:rn214@hermes.cam.ac.uk>>:
> 
> 
> 
>     Paul Kaplan wrote:
> 
>     >>So I'm looking for a Windows software that will let me clone the
>     IBM hard
>     >>disk, entirely, with all its partitions and data, onto the Samsung
>     hard
>     >>disk.
> 
>     Boot the laptop with knoppix. Then, something like:
> 
> 
>     dd if=/dev/hda1 | ssh root@des-machine -e "cat /dev/hdX1"
> 
> 
>     This assumes you have the samsung disk mounted in another machine.
> 
>     Notes:
> 
>     1)check my syntax - I am not certain it's correct
> 
>     2)Remember to test the new image!
> 
>     3)Think carefully about partitions. If you copy them over partition at a
>     time, you'll need to partition the new disk first. If you copy over the
>     entire disk (dev/hda rather than dev/hda1), then what happens if the two
>     disks are not exactly the same size?
> 
>     Richard
>     --
>     The linux-thinkpad mailing list home page is at:
>     http://mailman.linux-thinkpad.org/mailman/listinfo/linux-thinkpad
> 
> 
> 
> 
> -- 
> 
> Jaime Iniesta AKA Capitán planeta
> email: capitanplaneta ARROBA gmail PUNTO com
> jabber: capitanplaneta ARROBA jabberes PUNTO org
> webs: http://capitanplaneta.blogspot.com/