How to Defragment Hiberfil

In Windows, "hibernation" is a low-power state in which the contents of the computer's memory are saved to the hard drive and the computer is shut off completely. When the computer is turned back on, the hibernation file is loaded back into memory and the computer returns to the state it was in before it turned off. The hibernation file remains on the computer and, because it is extremely large, it can become fragmented, extending the amount of time it takes to resume from hibernation. Defragment the hibernation file--Hiberfil.sys--to minimize the amount of time required to resume from hibernation.

...
A computer's hibernation file is as large as the physical memory installed.

Step

Press the Windows logo and "R" keys simultaneously to display the "Run" dialog box. Type "cmd" in the box and press "Enter." The command prompt is displayed.

Step

Type "powercfg /hibernate off" and press "Enter." No confirmation is displayed by Windows for this command. This causes Windows to temporarily disable hibernation, which deletes Hiberfil.sys. Minimize the command prompt.

Step

Click the "Start" button, then click "Computer" in Windows 7 and Vista or "My Computer" in Windows XP.

Step

Right-click your hard drive, then click "Properties."

Step

Click the "Tools" tab, then click "Defragment Now."

Step

Click the "Defragment" button. Windows defragments the hard drive, moving all of the free space on the drive together so that when the hibernation file is recreated, it will no longer be fragmented.

Step

Close the Disk Defragmenter when the process is complete.

Step

Bring the command prompt window back up and type "powercfg /hibernate on." Press "Enter." Close the command prompt. The next time the computer goes into hibernation, the hibernation file will be recreated without fragmentation.