Want to show your appreciation? Please to my charity.

Monday, December 21, 2015

Downsize HDD on Your Windows Box

Upgrade a laptop from HDD to SSD is probably the best investment for performance. I have done it for a lot of them for my friends and relatives. For most of time, it is always a good idea to take the opportunity to clean up the system by reinstalling the OS. But today, my friend handed me a 2nd hand laptop with Windows 7 and Office 2010 on it but there is neither COA in the back of the computer, nor does she have the product keys.

So I was challenged to downsize her 320GB HDD to 128G SSD. I started the venture and finally done now although there were quite some bumpers along the way. I will not go through every each mistakes that I have made but thought should document the correct process for someone else or myself will need to do the same again.

Backup Your Computer

Use an external HDD or NAS to back up your computer, Windows 7 have build-in support to do this. Go to Control Panel and search for “Back and Restore”.

Preparation

  1. You can either use DVD Writer drive or USB drive if your computer can boot from USB HDD. I used two microSD card with a tiny USB card reader. I have a batch of 4GB/8GB microSD cards but essentially one used 4GB and another used 2GB. You may be able to fix all into one 4GB or 8GB card.
  2. You’ll need to somehow attach both disk to the computer. Either your computer can fit both or use an external HDD enclosure. This was easy for me because the SSD was mSATA so Thinkpad X220 can fit in both HDD and SSD.
  3. Windows 7 installation DVD, or bootable USB Drive. I have Windows 7 installer in one of microSD cards. To create one, you’ll need a 4GB+ USB memory stick, or any memory card with an USB card reader, and use the tools below
    • ISO to USB was the tool I used long time back to create a bootable USB memory stick from an ISO image
    • If you don’t have Windows 7 installation DVD ISO image, you maybe able to download one somewhere or create on from the installation DVD, I have used both Win32 Disk Imager (just for that) and DAEMON Tools Lite (plus a virtual drive) with great success.
    • You can also mix this with next two items for this purpose, but I already and also prefer to have a separate one for Windows Installer.
  4. GParted for resizing partition. The site has instruction to created a dedicated CD or USB. It also come with most of Linux DVD. I used my existing Ubuntu ISO.
  5. Clonezilla for disk cloning. Similarly, the site has instruction to created a dedicated CD or USB. But I used Easy2Boot to combine it with Ubuntu image into one bootable USB. If you don’t have and need Ubuntu, you can just combine GParted and Clonezilla with Easy2Boot. You can possibly further combine Windows 7 Installer into the same Easy2Boot disk if you’d like.

In Action

  1. Again, backup your computer. You can backup system after the clean up in next step but you risk the mistake you may take during the clean up.
  2. Clean up your existing HDD to make sure the C drive is much less than the size of new SSD so you have enough free space after downsizing. This was not a problem for me as existing HDD has only 45GB data in it. Having larger free size can also help with defragmentation and resize later. Sometime, you just need to move videos and images to external storage first.
  3. Defragment the C drive. This will take a long while.
  4. Attached new SSD drive to the computer, initialize the disk with MGR. I don’t have much experience with GPT and my the existing disk was MBR too.
  5. Boot into GParted, resize the C partition (not System Reserved partition that is only 100M) on HDD to be able to fit into SSD. You can check the SSD size in GParted, I resized C on HDD to be 1GB less than SSD capacity.
  6. Reboot computer normally into Windows 7, it will most likely run check disk on C, or even run system recovery. Let it complete what it need to do. You should have a much smaller C drive now.
  7. Reboot into Clonezilla, go to command line and run ‘sudo fdisk’. First record the exact parameter of the 100M system reserved partition. Exit and fdisk the SSD drive. Create first partition with exactly same parameter as we recorded for system reserved partition. Create another partition for the remaining space. Make system reserved partition active and make sure to change ID to 7 for both partitions. Exit command line and back to Clonezilla
  8. Use local partition to partition clone option to copy the 100MB system reserved partition first, then use the same process to copy C partition from HDD to SDD.
  9. Remove the old HDD now and try to boot from SSD. If everything get up and running and you have C drive, Congrats! But
  10. But I got an error screen in text immediately attempting to boot from SSD. Need to boot from Windows installer DVD or USB and run repair. This should allow you to boot into Windows.
  11. In my case, it took a long time to log in to an empty screen. Press Ctl-Alt-Delete and select Start Task Manager. Use File->New Task (Run…) menu item and click on Browse button. I noticed that the C driver was missing and my primary partition as E drive, yours may be a different drive. Please remember the driver letter as we’ll need it later. You can start explore.exe or cmd.exe from there but what you can do with the computer is greatly limited. the real problem is that you cannot start regedit.exe.
  12. Fix the driver letter problem! Boot with your Windows Installer DVD or USB again into recovery console, follow the instructions here, but you need to open SYSTEM hive instead, give name as NEWSYSTEM
  13. You need to edit the registry key to change the drive letter of your primary partition. Replace HKEY_LOCAL_MACHINE\SYSTEM\ in the instruction with HKEY_LOCAL_MACHINE\NEWSYSTEM\
  14. Restart the computer and now all is good. I add the old HDD back and re-partitioned to be a large spare drive.