[ltp] Cloning a hard disk?

linux-thinkpad@linux-thinkpad.org linux-thinkpad@linux-thinkpad.org
Thu, 18 Aug 2005 13:26:28 -0700


> 
> 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.
> 


I image the filesystems after boot with knoppix, e.g.

mkdir /target  <-- WinXP partition
mkdir /target2  <-- Recovery partition

on some remote drive (or computer):

mkdir -p /usr/local/rsync/Thinkpad_Factory_Image/WinXP_partition
mkdir /usr/local/rsync/Thinkpad_Factory_Image/Recovery_partition

then sync it over with rsync:

rsync -av /target/ <user@host:>/usr/local/rsync/Thinkpad_Factory_Image/WinXP_partition
rsync -av /target2/ <user@host:>/usr/local/rsync/Thinkpad_Factory_Image/Rescue_partition

this will not save the Predesktop Environment special disk area at the
end of the hard drive.  but that apparently can be done with dd.

one nice thing about this is that you have the fully-mirrored image of
the filesystems.

but Windows seems to be really bitchy about being moved around this way.
with Linux it is no problem to move filesystems around between different
partitions and machines, so long as /etc/fstab and the boot loader
config is updated to reflect the new filesystem location.  Windows
however has a tendency to freak out and not boot.