Saturday, January 2, 2016

Clone Windows 7 Hard Drive to an SSD

Like everyone else i have been gradually moving my hard disks to SSD's.  The current project was to move one of Liam's gaming computers to SSD.

The windows hard drive is 500gig, the SSD is 250 gig. On a mac this is not a problem as carbon copy cloner can easily move a larger drive (assuming it is not full) to as smaller one. On the PC side i have been using clonezilla for a long time but it is really set up to clone smaller drives to bigger.

However, its advanced options can be set to clone partitions, so i thoughi i'd just fire up the windows disk management tool and shrink the windows primary partition from 465gig to 130 gig to make it fit on the SSD. I assume this would be no problem as there is only about 60gig of files on the drive.

As it turns out, windows is very stupid - when it encounters an 'unmovable' system file or folder it cannot shrink the partition, so out of the box i could only get a 400gb partition, too big to clone. How to delete the file stuck at the 400gig point?

Defragging the drive does not help as windows won't move/re-locate these files. The solution is to find out which files are unmovable and delete them manually.

First i did these:

  • Disable System Restore (Right click on Computer => Properties => System Protection => System Restore)
  • Disable Virtual Memory (Right click on Comptuer => Properties => Advanced System Settings => Performance (Settings) => Advanced Tab => Virtual Memory (Change) => No Paging File => Set.
  • Ran Disk Cleanup to get rid of Thumbnails, Temporary Internet Files, and other crap
  • Turned off the trash so it deleted stuff immediately
  • Reboot and defrag just in case
  • And run the shrink disk analysis again, only slightly smaller - as expected no joy here
  • Right click on Computer => Manage => Event Viewer => Windows Logs => Application.
  • Click on Filter Current Log, and put ‘259’ for the Event ID
  • Bingo - the culprit was a 16gig hibernation file! (the file is = the amount of ram)
  • Ran terminal as admin and used:

     powercfg.exe /hibernate off

Then i deleted the hiber***.sys file in the disk root level. (you have to turn on hidden/system files to see this)

Now re-ran the disk managment and did another shrink analysis and yes - we can now shrink the primary partition down to 60 + gigs.

So the problem is that windows is not smart enough to move files when shrinking a partition....

Notes - as i have to do this again when i upgrade main work system to SSD

No comments: