Cloning parition table on a new disk

If you use sfdisk to backup the partition table, that will make the partition structure on the new drive when you restore it. Here are the commands...

Save the ENTIRE PARTITION TABLE to a file using sfdisk.

sfdisk –d /dev/hda > /mnt/images/backup/partfile

Restore that partition table from files to the new hard drive using the command:
sfdisk /dev/hda < /mnt/images/backup/partfile

I happen to have a script which I use from a rescue cdrom which automates the restore process.....


Bootup with the rescue cd and run the clone script to restore the images to your new hard drive.

 

Code:

#!/bin/bash
#
clear
echo
echo "********************************************************************"
echo "     Caution!!!     This program will erase your hard drive"
echo
echo -n "                Do you want to proceed (Y/N)?"
read answer
if test "$answer" != "Y" -a "$answer" != "y";
then exit 0;
fi
#
clear
#
#Erase the old boot sector
dd if=/dev/zero if=/dev/hda bs=512 count=1
#
#Restore the partition table from file
sfdisk /dev/hda < /mnt/images/backup/partfile
#
#Restore the MBR from file
#dd if=/mnt/images/backup/mbrfile of=/dev/hda bs=512 count=1
clear
#
#Restore the images with Partimage
partimage restore -b -z2 -f3 /dev/hda1 /mnt/images/backup/windows.000
#
partimage restore -b -z2 -f3 /dev/hda2 /mnt/images/backup/linux.000
#
clear
echo "Image restore is complete"
echo
#
#

 

http://www.mondorescue.org
Free, doesn't do well with major hardware differences.

http://www.acronis.com
Not free, does a better job but costs more.
Acronis True image server Echo for Linux (It should be arriving any day now).

Norton Ghost:
Effective but no support for using it on Linux