Hibernation explained. How to delete Hiberfil.sys in Windows 8 or 10.

Hibernation explained. How to delete Hiberfil.sys in Windows 8 or 10.

by Pete Daniel on 14 November 2014 · 46245 views

The Windows computer has the option to hibernate. This is a function where the current state of the running Windows system is saved to disk so that it can be restored back to that current state again more quickly. The purpose of hibernation is to avoid the need to completely reboot the Windows operating system and to reduce power consumption while away from the computer.

The speed with which a Windows operating system can return from hibernation depends on the speed of the hard drive to load the files back into memory (a SSD will be much faster than a traditional hard drive, hence the 2-3 second start times quoted on ultrabooks equipped with solid state drives when resuming from hibernation).

The Windows operating system uses the hiberfil.sys file usually stored in the root folder of the system drive where the Windows operating system resides. Bear in mind that this file is a system protected file and therefore hidden by default. You can use this guide to make it visible: How to show hidden files, folders, drives, and protected system files in Explorer under Windows 8 or 10.

hiberfil.sys in File Explorer

Enabling Hibernation

1. Open an elevated command prompt.

2. Type powercfg -h on, then press Enter.

At this point a hiberfil.sys file is created in the Windows partition's root folder. You can now add 'Hibernate' as an alternative shutdown option in Windows 8, 10 if you wish.

Disabling Hibernation and Deleting Hiberfil.sys

To disable the Hibernation feature in Windows and delete the hiberfil.sys file in the process, do this:

1. Open an elevated command prompt.

2. Type powercfg -h off, then press Enter.

You'll notice hiberfil.sys is gone and the option to Hibernate is no longer present as a Shutdown option.

Controlling the Size of the Hibernation File

The Hibernation file is commonly about 75 percent of the size of the installed RAM memory with Windows 8. The remaining 25 percent is stored in the paging file which helps Windows to load regular system elements faster. The hibernation process has been altered to ensure hiberfil.sys contains the Windows 8 kernel and device drivers which reduces some of the size issues.

Unlike previous versions of Windows where the hibernation file could sometimes reach an ungodly file size, the hibernation file within Windows 8 stays fairly constant. The size of the file relates directly to the installed RAM, therefore a system with 16 GB of installed memory will need 12-16 GB available just for the hibernation file. Not usually a problem with traditional hard drives, but something that can take a chunk out of a 128 GB SSD configuration.

To try to contain the size of the hiberfil.sys file in Windows 8 it is possible to use the command line to manage the file size. Entering the command below in an elevated command prompt will tell Windows to only place 50 percent of what is in the RAM into the hiberfil.sys file:

powercfg.exe /hibernate /size 50

1 full Hibernation explained How to delete Hiberfilsys in Windows 8 or 10

The 50 percent setting is the lowest option available.

In a related article, we also explain the swap file and page file in Windows.

Comments (7)
kshu on 4 Sep 2015
That's what I was saying too, option 6 there. It prompts for a UAC. One way to bypass that would be by using this tutorial http://www.download3k.com/articles/How-to-make-an-Elevated-Program-Shortcut-without-a-UAC-Prompt-in-Windows-00805
martineau on 4 Sep 2015
A more secure way would be set the advanced properties of a shortcut to this batch file so that (only) it will run with administrative privileges. How to do that is described in Option Six of the following article: http://www.sevenforums.com/tutorials/11841-run-administrator.html
martineau on 3 Sep 2015
I guess I'm able to run it without encountering a UAC dialog either because I have turned off or my account has administrative privileges. Yes, I know what the conventional wisdom is about doing that, and it's probably good advice for many, but I believe the rest of the security and system backup tools that are installed offer me adequate protection without it — at least that's been the case so far.

Your mileage may vary. Regardless, even if there was one, it doesn't seem like it would be a major issue...maybe even a good thing if you accidental clicked-on it.
kshu on 3 Sep 2015
@martineau, this is a very nice tip you shared.

How do you launch this .bat file? Via the shortcut you mentioned, with admin privileges? That usually prompts a UAC dialog. Do you bypass it somehow?
martineau on 3 Sep 2015
Although disabling hibernation this way understandably makes it disappear as a system shutdown option, there's a simple technique that will allow you to still put your system into hibernation.

Doing so requires a small 3 line batch file which first re-enables the feature using powercfg.exe, then invokes another system utility command "shutdown /h" to hibernate the machine, which is then followed by another call to powercfg disables it again. Afterwards you can create a shortcut to batch file and put it on your desktop or somewhere convenient to be able to run it whenever you want.

Think of this as "Hibernation-On-Demand" because no hiberfil.sys exists until one is actually needed. Of course you need ensure there's always enough free disk space on drive C: to allow the creation of one when it's needed.

I've used this, in conjunction with the other techniques outlined on this website, to keep hiberfil.sys, as well as the other massive pagefile.sys and swapfile.sys system files off my C: drive/partition.

The documentation for the shutdown command — which still works in Windows 10 — can currently be found at the following location:

https://technet.microsoft.com/en-us/library/Cc732503.aspx

[Note the older Windows XP version of shutdown.exe doesn't have an "/h" option for hibernation. For that version of windows I used a third-party utility of the same name written by Andrej Budja which does support it (as well as another to put the computer to sleep).]
Show more comments
kshu on 12 Aug 2015
That's because you need to run the command in an elevated command prompt, not the regular command prompt. I added this clarification in the guide as well.

Here are several ways to open an Admin Command Prompt (also known as elevated command prompt): http://www.download3k.com/articles/What-is-an-Elevated-Command-Prompt-Several-ways-to-open-one-in-Windows-8-and-10-00434. The easiest way for me is by pressing Win+X then A. This opens the Power User Menu and then selects Command Prompt (Admin) from it.

I hope that works for you.
marabsky on 11 Aug 2015
I tried the command powercfg.exe /hibernate /size 50 and get the error message "Access is denied" so can't limit the file size in this manner.
Featured Articles