Today I want to share with you a true story that happened to me last week. Although a bit off-topic, you might find it amusing, useful, and a real time saver in case you ever need to do the same thing.When I bought my desktop PC last year, I purchased an SSD drive to use as the system drive (C:).My First Mistake
At the time, the prices of SSD devices was pretty steep so although I had some doubts, I convinced myself that a 40GB drive should be more than enough to accommodate everything I need. That was big mistake#1.As it turned out, the I-tunes backups of my iPhone, which (for some reason) can only be placed on "C:" already used 16GB. Now add to that my SQL Server installation, office and other essentials.Most of these applications, even when installed to a different drive, still use up space on the system drive. Soon I found myself struggling for space and using every trick in the book to free up as much space as possible on C: just to be able to work.When I decided it was time to install SQL 2012 on the host O/S and stop using it in a VM, I realized that no tricks will help me now - I need a larger drive.I happily went to my local hardware dealer and purchased a shiny new 128GB SSD. Since I didn't want to install the O/S from scratch, I looked around for disk imaging software to clone my original disk onto the new drive. Should be simple right? I was about to find out the harsh reality soon enough.I Find a Cloning Utility
A quick search on the internet revealed quite a few disk cloning utilities, some of them free, that claim to do the job. Some even had great reviews, so I quickly downloaded one, installed it and was extremely happy to receive the message "Disk Clone Completed Successfully."I changed the BIOS boot sequence, restarted the PC and received the cheerful message "BOOTMGR is missing." I said OK, no harm done and quickly reverted the BIOS settings back, restarted the PC, and guess what - the same message again.No worries. I booted into Windows recovery console which confirmed there is an issue with Windows start-up and suggested fixing it for me, which it did successfully. Booting back from my original drive succeeded and a quick look into Windows logs revealed that Windows blocked the cloning utility from gaining access to the boot sector.So much for "Successful cloning" within Windows.Cloning Outside Windows
I didn't give up. If I can't clone from within windows, I surely can clone from outside windows, right? I downloaded a fantastic boot disk (UBCD) pre-installed with many disk utilities, booted into its Windows XP PE (Pre-Installation) environment and it happily cloned the disk for me, this time successfully (or so I thought).I removed the old disk and plugged in the cloned copy in its place. I restarted the PC, and now it just hung after the BIOS messages with a small blinking cursor at the top- left corner of the screen. No worries and no harm was done. I have the magical windows recovery console which worked great last time!I placed the Windows DVD back in the drive, rebooted and indeed it again found a problem with Windows start-up. I clicked "Repair" and got the message "successfully repaired your Windows installation."I rebooted again, and my old friend, the top- left blinking cursor appeared again, and the PC just hung.No worries! I quickly plugged the old disk back in and moved the new disk to another slot, then rebooted again. This time, Windows boot menu appeared and now I had not one, but 2 "Windows 7 Ultimate" installations from which I was asked to choose. However, this time both of them worked. One booted from the old disk and one from the new one.But now I encountered a new issue.A New Problem
No matter which one I booted, the new drive was labeled as "E:" and not "C:," worse than that, the 128GB disk was identified by disk manager as having just 40GB although its hardware properties showed the correct size.Trying to extend the partition was strictly refused by windows with the very informative error message "Parameter is incorrect."After a few futile attempts to get this configuration working using some scary utilities to modify internal disk properties, and as I was about to give up about 4 hours into the job, I gathered my strength again and decided to try a different approach.I realized that Windows 7 has a built- in imaging utility for disaster recovery that should be able to do the trick.On we go.I deleted the partition from the new disk, booted again only to find out windows still thinks I have two operating systems. In the old days, we had boot.ini which could be manually edited, but it's no longer there in Windows 7.Sigh, take a deep breath - I can live with that. Windows was more than happy to create an image for me (note that you must have a 3rd drive to store the image on). I removed the old disk, plugged in the new one, booted again into windows recovery console. When I was asked to restore an image, it searched the disks for me, found my recent image and suggested to restore it.Delighted, I clicked "YES!" please restore my system on the new drive, only to receive a new error message: "no suitable disk found to restore the image on."I checked again, the new disk was identified correctly by the BIOS, and even by Windows itself in the "exclude disks" list. So why won't it restore the image on it???Things Get Frustrating
At this point, I was pulling my hair out (and I don't have much of it...), but I didn't give up. I remembered my wonderful boot disk with all its low- level disk utilities, it must find if there is something wrong with it.Again I booted into Windows PE and tried ALL available diagnostics on it. Nothing was found wrong. I used everything I could think of - removing MBR, wiping the disk clean with every possible utility but to no avail. Windows just decided it doesn't like my new disk and won't restore the image on it.I was just about ready to bite the bullet and re-install windows from scratch when I remembered that windows recovery console comes with a partition utility of its own called "Diskpart."As a last resort, I tried it.Diskpart Does the Trick
SELECT disk 0 (yes - that's diskpart language) followed by a CLEAN command finally did the trick. I rebooted, Windows agreed to recognize the new disk, restore the image on it and even agreed to extend the partition to the full 128GB.At last, I have my old O/S, running on the new disk and utilizing its full capacity. Yes, there still were some minor "leftover" issues and errors but nothing that I can't live with.All in all, it took more than 7 hours of work and a lot of frustration to make this work. I was also glad that I bought a heavy duty PC case which only suffered minor "frustration dents" in the process :-)BTW - I also managed to fix the boot menu issues with this cool boot manager (free for personal use) from https://neosmart.net/EasyBCD/In Conclusion
So to sum up my lessons from this experience:
- Don't convince yourself that the cheaper hardware will do when you suspect it might not. It will eventually cost you much more.
- Don't use cloning utilities to move operating systems - use the native Windows imaging.
- Don't use 3rd party disk partitioning utilities as windows doesn't seem to like them - use diskpart instead.
If you ever need to move your operating system from one disk to another, take a day off :-)