如何安全地解放C盤剩余磁盤空間?


注意, 本文所涉及到的方法和步驟僅供在工作機上使用, 請不要在服務器上使用, 否則后果自負. 當然, 工作機上使用除了錯后果也還是自負的. 呵呵.

 

筆者C盤磁盤空間只有44GB. 經常只剩下一兩個G的空間, 多打開幾個網頁, 解壓點什么東西, 或者看個dump, C盤空間就不夠了.

筆者在Windows基本維護上水平很爛, 一個大學剛畢業的小伙兒幫了我的忙.

 

除了使用Windows自帶的清理磁盤工具(可以清楚IE緩存等), 如下文件夾中的內容可以安全地刪除.

C:\Windows\Installer\$PatchCache$\Managed

C:\Windows\temp

C:\Users\<Username>\AppData\Local\Temp

 

如果去掉隱藏系統文件的Windows Explorer選項, 可以看到下面兩個很大的文件, hiberfil.sys和pagefile.sys.

image

他們其中一個是休眠的緩存文件, 另一個是虛擬內存文件.

 

關於休眠, 請參考下面的文字.

Windows has two power management modes that you can choose from:
One is Sleep Mode, which keeps the PC running in a low power state so you can almost instantly get back to what you were working on.
The other is Hibernate mode, which completely writes the memory out to the hard drive, and then powers the PC down entirely, so you can even take the battery out, put it back in, start back up, and be right back where you were.

Hibernate mode uses the hiberfil.sys file to store the the current state (memory) of the PC, and since it’s managed by Windows, you can’t delete the file.

可以使用下面的命令行來關閉休眠(Hibernate), 執行之后開始菜單里的Hibernate選項就不見了, 而且hiberfil.sys也不見啦.

powercfg -h off

 

至於虛擬內存文件, 可以參考下圖對其所在位置進行修改.

image

 

image

重啟后該選項的修改生效.

 

經過這些修改, 筆者的C盤空間一下子多出來了15個G! 呵呵.

現在磁盤很便宜, 如果沒有特別需求, 最好一次性給C盤留足空間, 免得日后麻煩. 已經用上了的機器數據挪來挪去不方便, 故為之.

 

參考資料

========================

The Patch Cache and Freeing Space

http://blogs.msdn.com/b/heaths/archive/2007/01/17/the-patch-cache-and-freeing-space.aspx

How to Turn Off and Disable Hibernation in Windows Vista

http://www.mydigitallife.info/how-to-turn-off-and-disable-hibernation-in-windows-vista/

What is hiberfil.sys and How Do I Delete It?

http://www.howtogeek.com/howto/15140/what-is-hiberfil.sys-and-how-do-i-delete-it/

Optimizing Your Paging File (PAGEFILE.SYS)

http://support.microsoft.com/kb/99768

Is it safe to Remove All Files from the Windows Temp ?

http://www.tomshardware.com/forum/230573-45-safe-remove-files-windows-temp

Windows 7 - What is C:\Users\PC\AppData\Local\Temp ?

http://www.sevenforums.com/general-discussion/205609-what-c-users-pc-appdata-local-temp.html


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM