Saturday, May 9, 2015

Cloning failing disk step by step

Having to deal with computers all the time I thought that swapping failing disk would be a breeze. Fortunately I did not have to do this many times and therefore I had not much experience doing this. This is the process I used and I hope it helps someone to save some time and to avoid my mistakes.

Diagnosing disk failure

If your computer behaves erratically  and some programs freeze for a long time, you may be experiencing a failing disk. To diagnose disk failure one can use Windows Event Viewer logs in combination with free tools that support S.M.A.R.T. diagnostic display. My tool of choice is Defraggler, but you can use any tool that works for you. Wikipedia has a page comparing various tools.
Open Event Viewer/Windows Logs/System and filter log for Critical and Error messages. Then look for messages from the atapi driver indicating timeouts, errors or other abnormalities. Open Defraggler and look in the Health tab for any values in red. You can also use your disk manufacturer diagnostic tools to determine if your drive is failing. After determining that your disk is failing do not delay replacing it. Your disk may completely fail without warning and you will loose all your data.

Step 1: chkdsk - check your disk

This is very important step and I strongly advice you not to skip it. Your cloning or imaging process may fail if you skip checking your disk. This step takes a lot of time so it is preferable to do it overnight or when your are not using your machine for a long time. During this step Windows chkdsk program will ensure that all sectors on your disk are readable and relocate the ones that aren't. You need to supply options to perform surface scan operation so your chkdsk command would look like this:
chkdsk c: /F /R /B
You can also execute  this operation from a disk properties dialog box. Go to the Tools tab and press "Check now" button. Do not forget to select scan for bad sectors check box. You may be asked to check your disk on the next reboot so select "yes" and reboot your machine. This will usually take several hours, given the size of a modern disk. After this operation completes, reboot your machine and repeat the operation. This time chkdsk should not find any bad sectors even if they were found the first time. If second pass of chkdsk finds new bad sectors, repeat scan until no more bad sectors are found during chkdsk pass. Your disk is now ready to be imaged. The computer can be used now as usual but do not delay replacing your disk!

Step 2: purchase a new disk

Purchase a new disk from whatever your favorite place is. Make sure that your disk is not smaller than the one you replacing, especially if your current disk is nearly full. If you are replacing disk in your laptop, make sure that the height of the disk will fit in to your laptop. Generally 7mm drive can replace 9mm drive but not the other way around. Pretty much any manufacturer supplies some sort of disk imaging software o clone your drive. Acronis True Image seems to be a popular choice. For my imaging needs I used Acronis software and you can use any software that can clone a drive or create image of a drive. Wikipedia has a good list of disk cloning software and comparison page.
Prepare a bootable media with your imaging software. Acronis allows you to create bootable CDROM or DVDROM. You can also create a bootable USB Flash drive.

Step 3: make an image

Boot from your CDROM or equivalent image containing your imaging software. Connect external USB HDD to your PC that you are going to image. The USB HDD should have enough room to contain compressed image of your failing disk. You can estimate this by taking amount of used space on the disk and multiplying it by 0.75. Compression usually works better than that, unless most of the content of your hard drive consists of videos. Follow steps in your software to select the source disk - your failing hard drive and the destination disk - your external USB drive. Before starting imaging process add following two files to be excluded from imaging:
$BadClus:Bad
$BadClus
These two files contain all of the bad clusters that were found during step 1. You want to exclude these files for two reasons - a) they have no usable content and b) they are not readable so they will make your imaging process fail.
Start your imaging process. It should take about 15 minutes for every 100MB of data but could be more or less depending on your disk speed. After completion of this step you will have image file that you can copy on to your replacement disk. If your old disk fails after this point you are safe since you have all your data backed up. I recommend to perform this step as soon as you discover that your disk is failing and do not wait for your replacement disk to arrive.

Step 4: write an image to your new disk

After receiving your new disk, install it in to your desktop or laptop. Boot from your bootable media that contains your imaging software and connect external USB drive containing image that you created in the previous step. Perform recovery process, restoring your image on to your new drive. Recovery process will take approximately the same amount of time as creation of the image file. After imaging process is completed you can remove your bootable media and boot from your new drive which should be possible if your original disk was bootable. Your recovery process is now completed and your can delete your disk image if you like. I would keep it for a few days just in case.

Final Notes

You can combine steps 3 and 4 in one step if you like, although I would advice against this. If you have a USB bay, you can plug your new drive in to it and directly image from your failing drive. This saves you one step but exposes you to possibility of a failure. Since steps one and three can be performed immediately after you find out that your disk is failing, your image will keep you safe if your disk is to fail while you are waiting for your replacement drive to arrive. I would rather invest $60 in to external USB drive that you can later use as backup, than $30 in to a USB bay which will be useless after you copy your disk. Of course if you have a desktop, you can simply plug new disk in to available SATA connector without the need for a USB bay. Still external USB drive is a good thing to have for your backups, which you should do anyway.

No comments: