Recently I had a hard drive go bad and used another drive as a temporary storage until I got a new one. Once I got the new drive I did not want to install Windows (using Vista at the time) and have to reinstall all my applications again.
Seems like the answer was to just copy all the files from my temporary drive onto my new drive. Only problem is that Windows has many locked and used files that it does not allow you to copy the entire system easily.
To the rescue, ,I used a CD based distro of Linux called Knoppix to copy the partition from one drive to another giving me an exact copy of the drive. Here is a page describing the process step-by-step:
http://www.nilbus.com/linux/disk-copy.phpBasically, you make the partition on the new drive the exact size of the partition of your old drive. You can do that within Windows or use the method in the above link.
After you have the partitions the same size, you can use a simple Linux command to copy the partition from your old drive to your new one. The primary method is with the command:
dd if=/dev/<original drive partition such as hda1> of=<new drive partition> bs=4096
That will copy the partition on the original drive to the new drive. The only thing else required is to copy the boot sector. The above link has the information on making the copy.
After this, you can enlarge your partition on the new drive is there is more room, otherwise you just reboot and go. It should have copied the entire system and work the same as it did on the old drive.
This worked fine for copying my Windows Vista partitions. Microsoft is supplying a backup program that will do all this for you to a point. In my situation, I had the system spread on over two drives so when I would run the backup, it forced the copying of both drives. I placed the backup in a blank partition I created on the new drive so it would be available with the other drives removed. When I tried the Complete PC restore from the Windows Vista disk, the first step it does on a restore is to wipe out all partitions on your target drive and the continue with restore the previous backup. In my case, that would have erased the partition I used for the backup, thus destroying the backup.
In the future most of this work will be able to be handled using the Windows Vista built in backup program.
Tip for Vista users: If you use the above method to copy a partition in Vista and use the resize partition tool in Linux, when you boot back into Vista, it may not show the correct amount of space free although the drive management console shows the correct partition sizes. This happened on both the partiions I copied. To fix, in Vista, I used the "shink" option to shrink both drives be a few megabytes and then expanded them again. This seemed to fix the problem..