Thursday, March 15, 2012

Wednesday, March 14, 2012

Shrink Windows 7 Volume 修改磁碟区的大小

自行测试的结果是要删除SVI folder,才能改到自己想要的size
下方有提到如何关闭VM和System Restore, 而删SIV是

"I pressed F8, selected repair computer, than opened the command prompt and removed the SVI folders without hassle!!"

rd /S/Q "system volume information"

-------------

How to shrink a partition with unmovable files in Windows 7 ?
(http://www.brandonchecketts.com/archives/how-to-shrink-a-partition-with-unmovable-files-in-windows-7)

For some reason Windows can’t figure out how to move some files around on disk. When attempting to shrink a volume, it will only allow you to shrink it to where the last immovable file is located. These are some things I found necessary to temporarily get rid of those immovable files so that an NTFS volume could be shrunk

1- Disable System Restore (Right click on Computer => Properties => System Protection => System Restore)
2- Disable Virtual Memory (Right click on Comptuer => Properties => Advanced System Settings => Performance (Settings) => Advanced Tab => Virtual Memory (Change) => No Paging File => Set.
3- Run Disk Cleanup to get rid of Thumbnails, Temporary Internet Files, and a bunch of other files that it makes no sense why they are immovable.
4- Restart the computer to have #1 and #2 take effect

Try to shrink the volume again. If it still is unreasonably large, you will then have to look at Event Viewer to find which file is at the boundary.
1- Right click on Computer => Manage => Event Viewer => Windows Logs => Application.
2- Click on Filter Current Log, and put ’259′ for the Event ID
3- Click on the latest event and look through the detail to find the problematic file. You can then attempt to delete that file (or set of files) manually. You may have to restart into safe mode to delete some files

It took me about 5 loops of doing the above before I was finally able to shrink my volume to the size that I wanted. After successful, you can then re-enable the features that you want (namely System Restore and Virtual Memory)

----------

http://superuser.com/questions/88131/how-to-shrink-windows-7-boot-partition-with-unmovable-files

In the low level tasks like working with HDD system partition I prefer to use native tools as much as possible, and switch to 3rd party tools only as a last resort, if none of native tools worked. So, directed by harrymc, I gave Windows Disk Management another try.

I first turned Virtual Memory and System Restore off, removed System Volume Information folders, and after that Disk Management utility allowed me to shrink C: partition as much as I needed. After that I turned the features back on.

There is one small native system utility that helped me to identify what is blocking my partition - fsutil. It can show you what is exactly the file that occupies some certain cluster. (Run fsutil volume querycluster /? for command usage). And to find the number of unmoveable cluster that is preventing Disk Management utility to shrink the partition, you can see Event Viewer for event 259. Or you can just calculate this cluster number given the available space to shrink the partition by and the cluster size.

Anyway, a filename will give you a hint to guess, what program or feature is locking your partition. And then you can turn it off or uninstall, and see if it helped. In my case turning off Virtual Memory and System Restore was enough. Sometimes it is also necessary to turn off hibernation, etc. And sometimes partition defragmentation may also help.

P.S.: Thanks everyone for answers. Probably 3rd party tools would also work in my case, and probably they are easier to use, but as I have already told, for such kind of tasks I prefer to use native tools as much as possible. Also, personal thanks to harrymc for the important hint.