Home » Recovering HP Laptop After Hard Drive Failure

Recovering HP Laptop After Hard Drive Failure

Recently, I had to repair a client laptop which had been dropped.
Whilst most of the system was ok and working, the hard drive was worse for wear as Windows 7 wouldn’t even start properly, despite the attempt to perform various things including a start-up repair.

In the end – the hard drive was riddled with bad sectors, many of which could not be bypassed or repaired and (after consultation with the client) the decision was made to purchase a new drive and attempt to clone the HP recovery partition to it and then use it, to restore the laptop back to factory defaults.

Before I begin to document how I achieved this, I cannot stress enough that if you have the opportunity to create recovery disks (CDs/DVDs or a USB stick) – to do it. Damage to your hard drive will make your system unusable and without a working recovery partition, you’d have little hope of restoring it (assuming you didn’t want to purchase another copy of Windows and didn’t have any recovery disks provided by the manufacturer).

This particular laptop had no recovery disks and the customer wanted to restore the laptop back to factory defaults, fortunately – whilst the hard drive was damaged – the recovery partition was intact.

NOTE: This process does NOT work for ALL laptop recovery partitions, it also does NOT work with GPT disks.

In order to clone the recovery partition, you will need the following:
1) Hiren’s Boot CD
2) A new hard drive (should be the same size or larger than original)
3) A USB to SATA connector (so you can plug the OLD hard drive into the USB)
4) A good understanding of partitions in Linux (as that’s where we need to do the bulk of the work)

Boot up Hiren’s Boot CD and choose the Linux boot option, which should (when it loads) offer you something called ‘Partition Editor’ – now we aren’t going to use this tool to do the work, but we’ll use this for reference to ensure we have both drives working, visible and that you can see a logical representation of your partitions.

Next, go into the console.
Instructions below assume that /dev/sda is the NEW drive and /dev/sdb is the OLD drive – you should substitute your drive as appropriate.

Enter the following:
sfdisk -d /dev/sdb > ~/part_table
This will back up the partition table from the old drive.

sfdisk /dev/sda < ~/part_table
This will restore the partition table to the new drive.

It may complain about the partition not sitting on a cylinder boundary, so you should use the –force option for the restore process.

Assuming the above steps are successful – continue with the following:

dd if=/dev/sdb of=/dev/sda bs=446 count=1
This will copy the MBR from the old drive to the new drive.

Assuming that your laptop is a standard HP and has 4 partitions (SYSTEM, Local Disk (Windows), HP_TOOLS and RECOVERY) – execute the following commands – be sure to triple-check your partitions before you do this.

I’m not certain if you need the HP_TOOLS partition or not, but I cloned it, the RECOVERY partition and the SYSTEM partitions (as all 3 were undamaged, it was only the windows install itself which was unrecoverable).

dd if=/dev/sdb1 of=/dev/sda1
Copies the FIRST partition of the old hard drive (in my case, this was SYSTEM).

You can repeat the above command, changing the ‘1’ to the partition number of your choice.
Whilst you COULD simply clone the entire drive, I was unsure how ‘dd’ handled bad sectors so didn’t want to potentially waste time.

There are of course other ways to do this, but this one worked for me and I’m documenting it whilst I remember.

Contact Me
* indicates required field