This method was created on a HP laptop, but can be adjusted for many other systems:
- Install the new hard disk in the laptop.
- Install the old hard disk in an external enclosure and connect to the computer.
- Boot the laptop with the Ubuntu live CD (10.10 in this case)
- Open a Terminal window
- Confirm the new empty drive is /dev/sda and the old drive is /dev/sdb. Confirm the recovery partition is/dev/sdb2.
- Type: dd if=/dev/sdb of=/dev/sda bs=512 count=1 to copy the exact partition table and MBR (Master Boot Record) to your new drive.
- Next type: partprobe to re-read the partition tables.
- Finally type: dd if=/dev/sdb2 of=/dev/sda2 bs=1M to copy the entire second partition containing the recovery software to the newly created partition.
- Run the recovery software as if you were using the original drive. (Pressing F11 on HP systems.)
- Once the recovery is completed, resize the partition to full size of the drive.