Saturday, November 13, 2010

Shrinking Windows 7 Physical System Disk

A while ago I blogged about how easy it is now to expand a Windows 7 or Server 2008 system disk, but try shrinking it. Well, let me rephrase that, it is easy now to shrink a system disk with Windows 7-but, not shrinking it to the size I wanted.

After I expanded the disk, I realized that I wanted to clone the hard disk to a smaller disk so I could use the larger disk to install Windows 7 64bit and still have my old disk in case I needed it.

My plan was to use Windows Home Server recovery cd to take a recent backup and put it on the smaller, but here is another techbyte: Windows Home Server cannot resize into a smaller disk even if you have a lot of un-used space! I needed a smaller size so I could do that.

Back to shrinking. In Windows 7 you can now shrink a disk. I have a disk approxametly 465gb with only about 65gb being used. I want to make it 215gb big. The first time I tried shrinking with Windows 7 this is what happened:

1. In Computer management, go to Disk Management.
2. Right Click the disk you want to shrink, and select shrink.
3. After an analysis, it comes back telling how much you can shrink the disk by, it told me I could only shrink it by 17gb! The problem is, that if you have a file that cannot be moved, it blocks you from actually shrinking by the amount you want. Here is the message in the application log:

A volume shrink analysis was initiated on volume (C:). This event log entry details information about the last unmovable file that could limit the maximum number of reclaimable bytes.

Diagnostic details:
- The last unmovable file appears to be: \Windows\SoftwareDistribution\DataStore\DataStore.edb::$DATA
- The last cluster of the file is: 0x700aa55
- Shrink potential target (LCN address): 0x12035b2
- The NTFS file flags are: ----D
- Shrink phase:

To find more details about this file please use the "fsutil volume querycluster \\?\Volume{efa59fe1-bcbc-11de-89e4-806e6f6e6963} 0x700aa55" command.

4. I stopped the Windows Update Service and deleted the Datastore folder which allowed me then to shrink the disk even more, but only by 34gb. So I thought, well I will run it twice, but then my Blackberry software was blocking it.

5. Back to the old school. I used GPARTED.

See the following Screenshots:

Selecting the Shrink Option

Analyzing the disk

Results only allow 17gb of shrinking

Based on information in Windows Log, I deleted the storage folder and Re-ran the analysis.

After running the Shrink Option, I now shrank by 34gb. This is way short of what I want.

This is where I ran a second analysis, and I still could not shrink the disk anymore. Now my Blackberry Software could not be moved.

Here is the GPARTED process running on my disk.

So I ran GParted to get the results I wanted.

Ok, so now I have the disk the size I want. Now I am going to try to back it up and restore it with Windows Home server restore to a smaller disk. Oh, by the way, I love Windows Home Server but it sucks that it cannot resize to smaller partitions like Ghost or Accronis, or as you can see GPARTED.

Windows has made great inroads in giving us the tools to resize the disks. Now that we can increase the system drive on the fly! We can also shrink the system disk, but I find it still limiting. Don't get rid of the third party tools yet.


PS: I ran Diskeeper to see if I could move the folders and files to the front but did not work for me.

Also see following links:
How to shrink Windows 7 disk
Download GPARTED

No comments: