Can I move Hibernation file (hiberfil.sys) to another drive?

When you hibernate your computer, the system dumps the entire memory contents to a file named hiberfil.sys in the system root folder. It’s a hidden & system file whose default size is 40 percent of total physical memory (RAM) on a Windows 10 computer. The fast startup feature also uses hibernation technology and the hiberfil.sys file.

If the physical memory on our computer is 16 GB, the default size of hiberfil.sys would be 6.4 GB. Many users, especially those who use a small-capacity SSD drive for the Windows partition, may be wondering if they can move hiberfil.sys from the system root folder to a different drive (like moving the pagefile.sys) to free up disk space on the system drive.

Can you move hiberfil.sys to another drive?

Moving hiberfil.sys to a different partition or drive is not possible.

It’s because the miniature file system drivers built into Windows boot files can only locate files in the root directory and load them into memory. Only during or after the system resumes from hibernation, the full file system drivers are loaded. The miniature file system driver can’t look at subdirectories or other drive letters, and it doesn’t understand mount points, hardlink, junctions, or the Windows registry.

Here is an old article by Raymond Chen of Microsoft that explains why relocating hiberfil.sys is not possible.

The article is several years old, and although we have an improved boot configuration since Windows Vista, moving the file is still not possible. There is no way to make Windows dump hiberfil.sys to a location that’s different from the system root.

In Windows Vista or higher, you may be able to create a boot configuration entry that points to hiberfil.sys using the boot loader \Windows\system32\winresume.exe. But this would not change the location where Windows saves hiberfil.sys. Secondly, hiberfil.sys is only valid if the last computer shutdown was hibernation, and the file is invalidated after a resume. So, there is no point in creating the custom BCD entry pointing to the hibernation file. But yes, it’s a slight improvement over the earlier Windows Operating Systems.

Relocate hiberfil.sys using the registry?

Recently, I came across a registry edit circulating on the internet, claiming to relocate hiberfil.sys to a different path. It suggests editing the Power Management registry value and setting the hiberfil.sys path under the following registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\BackupRestore\FilesNotToBackup

hibernation file move using regedit

That wouldn’t work at all! Please don’t try it.

The FilesNotToBackup key name itself is self-explanatory. The registry key specifies the names of the files and directories that backup applications and System Restore should not backup or restore. It has nothing to do with hibernation!

Workaround: Turn off hibernation or set to Reduced mode

If your system drive is full, follow the conventional steps to free up disk space. Also, you may turn off hibernation using the “powercfg.exe /hibernate off” command line from an admin command prompt. This will delete hiberfil.sys automatically. You can’t use the hibernation and Fast Startup features, though. If you want to turn it back on, run “powercfg.exe /hibernate on“.



Alternately, you can reduce the hibernation file size instead of turning it off entirely. To do so, run the following command line from admin Command Prompt:

powercfg /h /type reduced

reduced or full hiberfile type

If the command returns “the parameter is incorrect”, then run the following commands in the same order below:

powercfg /h /size 0

powercfg /h /type reduced

Note: If you wish to revert to the default (full) hibernation mode, run: “powercfg /h /type full

Powercfg.exe Hibernate command-line switches

POWERCFG /HIBERNATE <ON|OFF>
POWERCFG /HIBERNATE /SIZE <PERCENT_SIZE>
POWERCFG /HIBERNATE /TYPE <REDUCED|FULL>

Alias:
POWERCFG /H

Description:
Enables/disables the hibernate feature or sets the hiberfile size.

Parameter List:
<ON|OFF> Enables/disables the hibernate feature.

/SIZE <PERCENT_SIZE> Specifies the desired hiberfile size as a percentage 
of the total memory size. The default size cannot be smaller than 40. 
This parameter will also cause hibernate to be enabled.

/TYPE <REDUCED|FULL> Specifies the desired hiberfile type. A reduced
hiberfile only supports hiberboot.

Examples:
POWERCFG /HIBERNATE OFF
POWERCFG /HIBERNATE /SIZE 100
POWERCFG /HIBERNATE /TYPE REDUCED

In reduced mode, hiberfil.sys consumes disk space that equals only 20% of the RAM. The reduced mode is sufficient if you need the Fast Startup feature but don’t need the (full) hibernate and the hybrid sleep features; you can use the (S1-S3) sleep feature. It helps to set hiberfil.sys to “Reduced” if you’re running short of disk space on the system drive.

For more information, check out the article Disable Hibernation Without Disabling Fast Startup.


One small request: If you liked this post, please share this?

One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
  • Pin it!
  • Share it to your favorite blog + Facebook, Reddit
  • Tweet it!
So thank you so much for your support, my reader. It won't take more than 10 seconds of your time. The share buttons are right below. :)

Ramesh Srinivasan is passionate about Microsoft technologies and he has been a consecutive ten-time recipient of the Microsoft Most Valuable Professional award in the Windows Shell/Desktop Experience category, from 2003 to 2012. He loves to troubleshoot and write about Windows. Ramesh founded Winhelponline.com in 2005.

Leave a Comment