Tuesday, March 11, 2014

How to shrink Windows partition with unmovable files

The reason why Windows won’t let you shrink the volume is because there are immovable system files at the very end of the volume.  Do following steps 

  1. Run the Disk Cleanup Wizard, making sure to remove the hibernation file and all restore points.
  2. Disable System Restore
  3. Disable windows indexing
  4. Disable the pagefile ( Open up System in Control Panel, then Advanced System Settings \ Advanced \ Performance \ Advanced \ Change \ No Paging File.
  5. In the same Advanced Settings, go to Startup and Recovery \ Settings and then change the Write debugging information drop-down to “None” to disable the kernel memory dump.
  6. Disable Hibernation mode in your power options \ advanced power options screen or by runnuing powercfg -h off
  7. Reboot the machine, and then delete your c:\pagefile.sys file, following below
    1. takeown /f C:\Windows\System32\en-US\winload.exe.mui
    2. cacls C:\Windows\System32\en-US\winload.exe.mui /G <username>:F
Now that we’ve deleted almost every system file that we can, you should run at least one of these free defrag utilities, but preferably all of them, in order to move all of the files to the beginning of the volume, so we can force the Shrink volume feature to work.
  1. Power Defragmenter(GUI interface for sysinternals contig)
  2. Auslogics Disk Defrag
If you are encountering the MFT problem, then you won’t have too much luck even after running those utilities. What you’ll need to do is use one of the non-free defrag utilities that is able to move the MFT files. If somebody can suggest a free way to move the MFT, leave a note in the comments.
  1. You can download a 30-day free trial of Perfect Disk and then uninstall it when you are done. Or not.
At this point you should be able to shrink the partition, at least a decent amount. Once you’ve gotten the partition shrunk, you should re-enable those important files:
  1. Re-enable the Pagefile (Reverse instructions above)
  2. If you have issues re-enabling hibernate, follow these steps.
  3. Enabling System Restore or kernel debugging information is entirely up to you.
  4. Reboot.

No comments: