Let’s assume, you are replacing the hard drive and want to make sure that the copied Windows Vista system will start smoothly afterwards. There are some tricks you can use, to make the system bootable again, if it doesn’t start anymore.

First, you can boot from the Windows Vista installation DVD (if you have one) and start the recovery system. There you can let the recovery system try to repair the boot problems or you can start a shell and execute the following commands:

bootrec /fixmbr
bootrec /fixboot

These two commands do two things: The first installs the standard Windows MBR code (master boot record) that usually read the partition table, searches for the first primary partition that is marked as active and the execution jumps to the first sector the this partition. This first active primary partition is also called the system partition.

The second command installs the boot code into the system partition. This should then make sure to start the Windows Boot Manager.

However, Vista will silently fail to boot, if you didn’t copy the partition to the exact same position on the new hard drive, like I did. Only a blinking cursor will appear and the system hangs. I checked with diskpart that the system partition is indeed marked as active, but that didn’t help. There is something else missing.

A great tool to copy partitions and make full backups is PartClone which is in the very useful Clonezilla distribution. Clonezilla provides a live-CD from which you can boot and start partclone.

So, partclone is aware of the problem I ran into. And they provide a specific tool, to fix booting from NTFS partitions that have been copied to a different on-disk-location. The tool is called partclone.ntfsfixboot. It is include on the clonezilla live-CD and sourcecode can be found on the ntfsfixboot’s project page at sourceforge. You can start it first with the “-p” option, to see the current values: partclone.ntfsfixboot -p /dev/sda1. You’ll see three times values for number of heads, number of sectors and the start sector of the partition. Three times, because one value is the correct one, and the two other are from the NTFS sectors. If the values are different, then you’ll need to execute this program to fix it:

partclone.ntfsfixboot -w /dev/sda1

This will write the correct partition geometry and start sector to the relevant NTFS sectors and afterwards Windows Vista should boot again. ntfsfixboot should be executed automatically by Clonezilla/partclone if a NTFS partition has been cloned - but if not, now you know how to execute it manually.

In case you cloned from a hard drive with bad sectors, the NTFS filesystem probably has marked these sectors as bad. But in the new hard drive, they are good. That’s why you should execute chkdsk once manually, to revalidate these “bad” sectors:

chkdsk C: /B

This will reset the info about the bad sectors and does another scan of the disk to find any bad sectors. With the new hard drive, no bad sectors should be found.