76

I am running out of space on my %SYSTEMDRIVE% on Windows. There is hiberfil.sys file that size of it is almost 3GB.

I understand that hiberfil.sys is used for the windows hibernation feature. https://support.microsoft.com/en-us/help/13770/windows-shut-down-sleep-hibernate-your-pc

The Hiberfil.sys hidden system file is located in the root folder of the drive where the operating system is installed. The Windows Kernel Power Manager reserves this file when you install Windows. The size of this file is approximately equal to how much random access memory (RAM) is installed on the computer.

The computer uses the Hiberfil.sys file to store a copy of the system memory on the hard disk when the hybrid sleep setting is turned on. If this file is not present, the computer cannot hibernate.

I don't want to disable the hibernatation feature.

Is there any way to move hiberfil.sys to another drive other than %SYSTEMDRIVE%?

24

I don't think it is possible to "redirect" the path of your hiberfil.sys from "C:\hiberfil.sys" to "D:\hiberfil.sys" for example.

I did some research on Google and in the Windows registry, and found nothing but the option to disable it (and consequently delete hiberfil.sys file):

  1. Click Start, and then type cmd in the Start Search box.
  2. In the search results list, right-click Command Prompt, and then click Run as Administrator.
  3. When you are prompted by User Account Control, click Continue.
  4. At the command prompt, type powercfg.exe /hibernate off, and then press ENTER.
  5. Type exit and then press ENTER to close the Command Prompt window.
  • 12
    This is not the answer, the OP doesn't want to disable hibernation. – cjb110 Feb 8 '13 at 10:44
  • 1
    Thanks, once I ran the comment, the hiberfil.sys automatically remove. Thanks, I now have additional 32Gb on my SSD – Valamas Nov 13 '13 at 10:31
  • 2
    @cjb110 Yes. But any way it useful – FindOutIslamNow Mar 14 '18 at 13:14
  • it's not possible to move the file but it's possible to resize the file – phuclv Jun 30 '18 at 2:18
19

Instead of disabling hibernation, you can reduce the size of the hibernation file to a maximum of 50% of the total physical memory:

  1. Click Start, and then type cmd in the Start Search box.
  2. In the search results list, right-click Command Prompt, and then click Run as Administrator.
  3. When you are prompted by User Account Control, click Continue.
  4. At the command prompt, type powercfg.exe /hibernate /size 50, and then press ENTER.
  5. Type exit and then press ENTER to close the Command Prompt window.

The size of hiberfil.sys will be reduced immediately.

Update: Be aware that if your system RAM cannot be compressed to 50% of its size when you hibernate, you may get a blue screen with INTERNAL_POWER_ERROR similar to this one, which might be difficult to diagnose:

BSOD "INTERNAL_POWER_ERROR" in Windows 7 on hibernation

  • Diogo posted exactly the same solution before, and with attribution. -1 – Joris Groosman Nov 3 '15 at 14:55
  • 9
    @JorisGroosman This not the same solution. Please note the difference in step 4. The OP didn't want to disable hibernation as Diogo's solution does. The solution above cuts the size used by the hibernation in half. – mhu Nov 5 '15 at 19:52
  • Yes just to confirm, I'm someone who came to this post with a similar question - it worked here. It reduced the size of my hibernation file from over 6 to just over 4 gigabytes. It wouldn't let me reduce to less than 50% of RAM so that may be as low as it gets - I tried 25% but the file stayed the same size as for 50%. I have 8 gigs of installed RAM – Robert Walker Jul 17 '17 at 1:16
16

Unlike SLEEP mode, where everything that is running on your system is stored in your RAM, (which is kept powered), HIBERNATION copies the entire state of your RAM to a file called HIBERFIL.sys. That is why that file has to be at least as big as the size of your RAM. Your computer turns off altogether, as it doesn't have to have any of your components under constant power.

BUT, next time you want to get your machine woken up from Hibernation state, to find it at the same point where you left it, it needs that boot-up sector of your System disk...

Unfortunately there's no way to move that HIBERFIL.sys around to your other HDDs or partitions.

This is unlike PAGEFILE.sys, which you CAN relocate to some other physical disk or partition, so your system disk doesn't have to handle the Pagefile.

5

You can only disable it, not move it because, when present, hiberfil.sys is needed much earlier in the OS boot sequence.

At that point in the boot sequence, the OS is not able to understand symbolic links,

So the only place it will look for hiberfil.sys is on the OS root drive. More on Relocate hiberfil.sys

  • Thank you for the sensible explanation about why this can't be moved! – glenviewjeff Oct 8 at 13:39
0

It should be on the same disk as booloader (NTLDR/BOOTMGR) so bootloader can pick it up early and copy to RAM.

Try moving the bootloader.

  • After moving bootloader, How could I redirect the path of hiberfil.sys ? – hamed Mar 20 '12 at 19:32
  • It will be on the same partition as bootloader, in the root folder. – Mikhail Kupchik Mar 29 '12 at 11:47
  • 5
    My bootloader is in other drive, I was suspected. I think it don't related to bootloader. It related the Windows partition. – hamed Mar 30 '12 at 14:49
  • 1
    This is actually the closest to an answer I think, you can't tell windows to look some where else. But it depends does windows look at the root of where it's installed, or the root of the boot drive?? (these by default are the same, but by no means have to be). If its the latter then this answer will work (if fiddly to achieve). – cjb110 Feb 8 '13 at 10:43
  • 6
    False answer. In Windows Vista and later, the bootloader is located on a hidden partition while hiberfil.sys is located in C: – user477799 Jan 16 '17 at 11:48
-1

To stop the Hibernation service in Windows Vista or 7:

  1. Click on the Start button and in the Search field type cmd
  2. When the command prompt opens, type powercfg.exe -h off
  3. Exit the command prompt

At this point a few important things will have taken place in Windows:

  1. hiberfil.sys no longer exists in Explorer (i.e. is deleted, thus freeing up a lot of disk space),
  2. "Hibernate" is no longer available from the Shutdown options in the Start menu, and
  3. obviously, you will no longer be able to place Windows into a hibernation state (S4).
  • 6
    In the question is explicitly stated "I don't want to disable hibernate." Hence your is not helpful in this case. – Robert Nov 23 '12 at 15:56
  • Likey - coz I no longer hibernate - I use sleep – killjoy Aug 14 '18 at 20:14

protected by slhck Feb 8 '13 at 10:17

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.