none
relocate hiberfil.sys

    Question

  • Is there a way to relocate hiberfil.sys to a different drive? I want to put the OS on an SSD, but the hiberfil.sys space pushes me into a 64G SSD, which is too expensive. I did find a registry entry ...\22000002\Element that has the value \hiberfil.sys, so it seems like it might be possible...
    Friday, June 19, 2009 11:24 PM

Answers

  • Thanks Alex - I didn't catch that reference when I searched for an answer. I do wish the guy had been more specific, instead of just saying that there are "reasons" why hiberfil.sys must be on the OS volume. I can understand having restrictions based on having limited disk controller support duing a hbiernation restore or such, but then the (theoretical) hiberfil.sys location configuration tool could be smart about where it lets you put the hibernation file...

    Hi David

    Here is a link to the definitive explanation for the inability to move the hibernation and other files to another drive.

    The File System Paradox

    Hope this helps.

    Thank You for testing Windows 7

    Ronnie Vernon MVP
    Monday, June 22, 2009 10:04 PM
    Moderator
  • grnhair,

    Sorry, but you absolutely can not move hiberfil.sys to a different drive. The closest thing I could find to an official statement by Microsoft was this MVP forum post from 2004, but it can't be done.
    -Alex
    Saturday, June 20, 2009 2:12 PM

All replies

  • I don’t know if it can be moved but if you’re not using it, it can be turned off. 

    You will save the equivalent in hard drive space as RAM that is installed by turning it off.

    In a Run window, type powercfg.exe -h off and press Enter. To turn it back on, type powercfg.exe -h on and press Enter.

    Saturday, June 20, 2009 7:36 AM
  • Yea, it is turned off right now, but I do like to use hibernation. It is especially nice when coupled with my UPS's auto-shutdown feature, which will hibernate my computer on a power outage if I have hibernation enabled.

    I pulled the trigger on the SSD, so this is a non-theoretical question...
    Saturday, June 20, 2009 12:56 PM
  • grnhair,

    Sorry, but you absolutely can not move hiberfil.sys to a different drive. The closest thing I could find to an official statement by Microsoft was this MVP forum post from 2004, but it can't be done.
    -Alex
    Saturday, June 20, 2009 2:12 PM
  • Don't think it's possible, which is nothing new. MS' insistence on putting everything on the system drive is appalling, how did swap file location slip by their C-Drive Police? None more stupid than the dreaded Program Files, and of course x64 adds Program Files(x86) - why the H. do we need this!? I realize many of those things can be in fact moved but it just couldn't be something one would do thru an OS install or at the very least CP, now could it. No instead we need to change a bazillion reg keys and still suffer the consequences.

    I don't have an SSD just yet but I really feel for those who do and see their premium space disappearing due to MS' lazy and rude coding practices. Shame on you folks.

    Saturday, June 20, 2009 3:12 PM
  • Thanks Alex - I didn't catch that reference when I searched for an answer. I do wish the guy had been more specific, instead of just saying that there are "reasons" why hiberfil.sys must be on the OS volume. I can understand having restrictions based on having limited disk controller support duing a hbiernation restore or such, but then the (theoretical) hiberfil.sys location configuration tool could be smart about where it lets you put the hibernation file...

    Luna - "Program Files(x86)" is where 32-bit programs are installed by default on 64-bit Windows. Pesonally I call that a feature. And "lazy and rude coding practices"??? More like a combination of MS still figuring out how to do SSD right, and a previous lack of consumer desire because there wasn't a real need until SSD (i.e. not a priority).

    This will become a major issue as people swich to SSD for their OS/performance volume plus a sata disk for everything else. Another factor is increasing RAM sizes - I just bought 8GB DDR3 1800Mhz CL8 for $110 out the door! Carving out 8GB of my SSD for a hibernation file? ****!
    Saturday, June 20, 2009 7:20 PM
  • I don't know how Windows could be configured to save hiberfil to a different drive, but you could configure BOOTMGR to boot from a different location, using bcdedit.exe.

    To see the current settings enter bcdedit /enum all in a command prompt.  You will see a long list containing something like:

    Resume from Hibernate
    ---------------------
    identifier              {4b363540-4c2d-11de-a780-e56ff09d11cf}
    device                  partition=C:
    path                    \Windows\system32\winresume.exe
    description             Windows Resume Application
    locale                  en-US
    inherit                 {resumeloadersettings}
    filedevice              partition=C:
    filepath                \hiberfil.sys
    debugoptionenabled      No

    Filedevice and filepath specify the location and name of hiberfil.
    Saturday, June 20, 2009 7:42 PM
  • Thanks Alex - I didn't catch that reference when I searched for an answer. I do wish the guy had been more specific, instead of just saying that there are "reasons" why hiberfil.sys must be on the OS volume. I can understand having restrictions based on having limited disk controller support duing a hbiernation restore or such, but then the (theoretical) hiberfil.sys location configuration tool could be smart about where it lets you put the hibernation file...

    Hi David

    Here is a link to the definitive explanation for the inability to move the hibernation and other files to another drive.

    The File System Paradox

    Hope this helps.

    Thank You for testing Windows 7

    Ronnie Vernon MVP
    Monday, June 22, 2009 10:04 PM
    Moderator

  • Here is a link to the definitive explanation for the inability to move the hibernation and other files to another drive.

    The File System Paradox

    Hope this helps.

    ------------------------

    So it is a driver issue. However, shouldn't that "miniature file system driver" be able to access any drive that is bootable? So fundamentally, can't
    hiberfil.sys be located on any bootable drive?

    Thanks

    Tuesday, June 23, 2009 5:36 PM
  • Yes, David, bootmgr should be able to access any available drive, for which it has a driver.

    The article is interesting, but somewhat out of date.  It refers to NTLDR boot.ini, and NTDETECT.COM, instead of bootmgr, BCD and \Windows\system32\winload.exe.

    It seems obvious to me that the "miniaiture file system driver" has to be contained within the boot sector, MBR and BIOS, in order to start loading bootmgr from the root of the designated drive.  Without basic filesystem support, it would not be able to locate nor read the root directory, much less interpret it correctly.  All this has to be done to locate the first and remaining clusters of bootmgr.  Note, BOOTMGR is specified by name in the NT60 boot sector, whereas an NT52 boot sector specifies NTLDR.

    Once bootmgr loads, enough about filesystems is known so that bootmgr can read c:\boot\BCD, and use values in that database, such as \Windows\system32\winload.exe, the usual loader path for a NT60 operating system.

    For hiberfil.sys, the loader is \Windows\system32\winresume.exe.

    As I said in my previous post, you could change the location for \Windows\system32\winresume.exe to load hiberfil.sys.  But this would not change the location where Windows saves hiberfile.sys.  That would have to be acomplished elsewhere.

    Not only that, I think there are practical reasons why memory intensive files such as hiberfil.sys and pagefile.sys can only work correctly on the root.  Having to negotiate a folder heierarchy during such memory and disk activity would slow things down too much.
    Wednesday, June 24, 2009 9:54 PM
  • Thanks a lot. This did the trick. I am trying to clear free space off of a VM and (obviously) the VM doesn't need Hibernate!! :)
    Friday, January 21, 2011 6:21 PM
  • That 'File System Paradox' is an excuse not an explanation. Every OS has a single threaded boot version. The boot info is on one drive but the system drive can be on any disk; that is, all the disk partitions are accessable.

    Net, this could rather easily have been done and with the use of SSD drives for storing the OS and core systems, coupled with their price which can be 8-10x higher per gigabyte than a regular drive, this should have been done.

    While 'the dog ate my homework' tells me why it isn't provided, it isn't a very good answer. An incomplete with at least one letter grade reduction after it arrives.

    Friday, February 11, 2011 2:49 PM
  • Thanks a lot. This did the trick. I am trying to clear free space off of a VM and (obviously) the VM doesn't need Hibernate!! :)

    WHAT did the trick???

    Sunday, February 26, 2012 3:14 AM
  • I don’t know if it can be moved but if you’re not using it, it can be turned off. 

    You will save the equivalent in hard drive space as RAM that is installed by turning it off.

    In a Run window, type powercfg.exe -h off and press Enter. To turn it back on, type powercfg.exe -h on and press Enter.

    Interestingly, there is also access to Control Panel\All Control Panel Items\Power Options.

    Using the Balanced option, and manually setting Display and Computer Sleep to Nevers, does nothing to remove a massive hiberfil.sys (22GB on my 111GB Intel SSD). However, changing Power settings to High performance AND running 'powercfg.exe -h off' immediately removes the hiberfil.sys file.

    The hiberfil.sys and pagefil.sys files were massively bloated when I installed Adobe's new (launched yesterday) Creative Cloud. Disk free space dropped from 54GB to 27GB when I installed PhotoShop's 2GB. FYI, outside hiberfil and pagefile, my used space is a little under 27GB.

    Given the dynamics of Cloud and solid state technology being used everywhere in massive proportions, it seems very odd that Microsoft hasn't engineered the ability to move pagefile.sys and hibeerfil.sys to an alternative internal disk ... or better yet, an external service device! Say, somewhere inside microsoft.com. Hehehe.

    Saturday, May 12, 2012 8:14 PM
  • You cannot relocate but one major improvement in Windows 7 onwards is that you can compress it. From a admin command prompt, type this:

    powercfg hibernate size 60 (where 60 is the % of the size of hibernation file). Set it to 65% if you have problems with 60%. That will take 40% less size while still giving you the benefits of hibernation.

    Sunday, May 13, 2012 1:59 PM
  • david.wells  Is there a way to relocate hiberfil.sys to a different drive? I want to put the OS on an SSD, but the hiberfil.sys space pushes me into a 64G SSD, which is too expensive. I did find a registry entry ...\22000002\Element that has the value \hiberfil.sys, so it seems like it might be possible...

    `

    I don't think you can do that! My system is SSD, and I have some experience that may assist you. But before setting you at ease, just a few things to illustrate why hiberfil and sister pagefile are critical to system function, regardless of you setting their size to zero.

    `

    Brian Borg  I don't know how Windows could be configured to save hiberfil to a different drive... enterbcdedit /enum all in a command prompt.  You will see a long list containing something like:

    Resume from Hibernate
    ---------------------
    identifier              {4b363540-4c2d-11de-a780-e56ff09d11cf}
    device                  partition=C:
    path                    \Windows\system32\winresume.exe
    description             Windows Resume Application
    locale                  en-US
    inherit                 {resumeloadersettings}
    filedevice              partition=C:
    filepath                \hiberfil.sys
    debugoptionenabled      No

    Filedevice and filepath specify the location and name of hiberfil.

    `

    I have set to Never "Turn off the display" and "Put the computer to sleep". But we get the same bcdedit /enum all output. These are system defaults, and not descriptive of current system status. But why move hiberfil to another drive? Why not downsize it?

    `

    Are we all aware that there are two "sleep" provisions for the Windows OS? They are pagefile.sys and hiberfil.sys. They both create massive on-the-fly file space. And they are both becoming redundent on new hardware platforms. That is, their temporary file space can be set to zero. This is useful on Microsoft-based computers with 16GB or more of RAM and a Gen 3.0 or better motherboard. Gen 3 is a critical detail, becuase it uses processors with at least one additional layer to replace disc based (temporary files) with dynamic RAM supported system data management.

    `

    I like to keep my hiberfil and pagefile at "0". Using Microsoft softwares (Windows, Office, etc) that are obviously 64-bit capable and therefore Gen 3 friendly, and this is no problem.

    `

    Unfortunately, some primitve applications like Adobe Photoshop, while claiming to provide 64-bit operation, are actually dragged down by massive amounts of old 8-bit driver filters. To cut a long story short, primitive software will not run properly on Gen 3 as they are hiberfil and pagefile dependent. Best we can do is try and balance their bloat access: too much bloat and they loop into oblivion, too little bloat and they are lost.

    `

    Chucking an SSD into your system will not make it Gen 3. If you don't have the correct hardware, you have to accept for now a chubby baby profile! ;o)

    `

    My Gen 3 platform uses P8Z77 board with Intel 7037 CPU and 32 GB RAM. This is how I zero the bloat.

    `

    Hiberfil: Control Panel, Power Options, High Performance, Change plan settings, Never...
    also: Start, All Programs, Accessories, Command Prompt (right click and Run as administrator), powercfg.exe /hibernate off   [on]

    Pagefile: Control Panel, System, Advanced system settings, Advanced tab, Performance settings, Advanced tab [again], Change, No page file...
    for Photoshop: Initial size 384, Maximum size 1152

    Thursday, November 22, 2012 4:36 PM
  • Unfortunately, some primitve applications like Adobe Photoshop, while claiming to provide 64-bit operation, are actually dragged down by massive amounts of old 8-bit driver filters. To cut a long story short, primitive software will not run properly on Gen 3 as they are hiberfil and pagefile dependent. Best we can do is try and balance their bloat access: too much bloat and they loop into oblivion, too little bloat and they are lost.

    Honestly, I TRY SO HARD to get Microsoft to lauch its own Gen 3 friendly graphics editor. Photoshop 'os' is so... bloated! Maybe we need to get organized, 1.4 billion people using computers in the real world. We herein declare we are on strike without end. No more decent graphics until Microsoft gived us a stable graphics editor.

    `

    Hell-oo-oo-o! Microsoft!


    Thursday, November 22, 2012 6:04 PM
  • SSD storage keeps coming down in price.  It's no longer necessary to live with too little space on drive C:, nor is it important to worry about actually writing too much to your SSD any more.

    May I suggest outfitting your system with multiple SSDs in RAID 0 configuration.  Make one huge drive C: (e.g., 2 TB) and organize things by subfolders.  Use separate volumes (e.g., spinning HDDs) for storage only of things you access rarely, and backups.

    It's what I do.  It really works and kicks performance of everything into orbit.

     

    -Noel


    Detailed how-to in my eBooks:  

    Configure The Windows 7 "To Work" Options
    Configure The Windows 8 "To Work" Options

    • Edited by Noel Carboni Saturday, November 24, 2012 5:55 PM
    Saturday, November 24, 2012 5:55 PM
  • Are you seriously recommending that we put our most critical files (those needed to even use a machine) on a RAID 0 (ZERO/NO RAID) ?! How do you have 11,245 points? Raid 10 sure, but then again, we'd be back at a cost-prohibitive solutions.

    If the question were something like "I need more space on my C drive without losing hibernation and money isn't an object", then RAID 10 would be an answer, but RAID 0 is a joke that even performance-centric gaming kids hardly touch these days.

    The bottom line is that aside from laziness on the part of MS, there is NO reason that hiberfil needs to be on the boot partition. Sure, it might be slightly less "stable" elsewhere in theory, but in reality, it would be at least twice as safe because there would be 1/2 the chance of it failing to be available due to a drive dying (since it would be on a 2nd drive in nearly every case else there would be no need to move it to another partition).

    I'm going to try and junction/link it elsewhere and see if I can pull that off.


    I.T. Man of many talents, master of none. Android enthusiast and owner of http://AllDroid.org

    Monday, August 05, 2013 4:03 AM
  • Hello good people,

    I also suffer from installing Windows 8 on an SSD while dreaming of putting most of Windows on the SATA D drive.

    @xpclient Your suggestion works but the command is slightly incorrect. On my Win 8 machine, in Admin CMD I used:

    powercfg.exe hibernate size 60

    After I did that it said, "The hiberfile size has been set to: 10239705088 bytes."

    But when I type in powercfg.exe /hibernate on nothing happens.

    Before I did the 60% thing I tried the command to enable hibernation and it responded that I didn't have enough disk space.

    Gee I wish the engineers at Microsoft who wrote that response would have brought it up the next day in their stand up meeting so that the people on the other side of the room could suggest a meeting later that day where they would brainstorm moving SYS files to an alternate device (i.e. D drive) to allow Windows PURCHASERS to use Windows 8 on devices with smaller SSD drives.

    I've got an MSI GT-60 (POS that blue screens randomly only when vital work is in progress), and with 16 GB of RAM it's hard as heck to get hibernate to work on the 60 GB SSD.

    It's okay if Microsoft opened the world to computers and then fell behind. Just make sure when you get an SSD drive for your OS, that it's at least a 250 GB drive. Even then, install all your apps to D drive when given the open.

    Please ping me if the good people of Redmond ever allow us to move the hibernate and pagefiles to D drive please! :)

    Chris

    Friday, August 16, 2013 12:26 PM
  • Are you seriously recommending that we put our most critical files (those needed to even use a machine) on a RAID 0 (ZERO/NO RAID) ?! How do you have 11,245 points? Raid 10 sure, but then again, we'd be back at a cost-prohibitive solutions.

    Yes, seriously.

    You clearly don't know too much about hardware or things like MTBF.

    Buy good quality SSD hardware and 4 SSDs in RAID 0 is still far less likely to fail than one cheap electromechanical HDD.

    I have one word for you:  Backup

       

    -Noel


    Detailed how-to in my eBooks:  

    Configure The Windows 7 "To Work" Options
    Configure The Windows 8 "To Work" Options

    Saturday, August 17, 2013 12:30 AM
  • 4xSSD in RAID0 is not the best idea. On most systems, if done in hardware, this eliminates TRIM functions dropping your performance and you've increased your overall chances of failure. I've had two SSDs fail, granted lower overall failure rate than spindle drives, but losing 1 out of 4 is the same as losing all 4 from an operational perspective in that configuration. RAID in any format should never be a backup plan, so yes of course backup as well. 

    An alternative would be hybrid drives in a RAID1 which would will give you excellent read performance, redundancy, more space, and eliminate any TRIM incompatibilities. Granted it won't give you the sustained write performance of an SSD or peak read access times, but it is pretty good. 

    Directly to the topic, an effective method I have found to work around this if you want the hibernate file on is to link your user or other folders to a drive 'D:' or even a network SMB or iSCSI target via symbolic links. This is a common solution in Unix and I'm not sure when exactly it made it's way to windows, but works in Windows 7+ for sure. This allows you to still save files to C:\users\John.Spade\ but have downloads actually be on D:\John-Spade-cFiles\ solving your hiberfil.sys total space problem by dynamically putting some data on another drive. Lifehacker has a simple example here. [note] I don't suggest doing this for \users\ and make sure you have an administrator account in case drive 'd:' fails so you can login.

    Since Adobe was mentioned as a space hog, while you don't really want to move 'Program Files', moving \Program Files\Adobe via symbolic link is not a terrible idea to free up a lot of C: space.

    Yet another solution to create more space ( and even easier ) is to open C:\users\John.Spade and right-click on Downloads or Pictures ( if you have lots of those things ). You will notice a Location tab. You're welcome.

    Finally, adding folder compression to \Program Files can often get you a few GB of space. If you do it from safe mode it will be more effective as it can compress more files that might be locked when open. Do not compress your user folder or \Program Data as some programs don't like it for some reason, notably Google (Nik) EFEX photo tools.

    -John Spade ( Connect )


    • Edited by John Spade Sunday, September 29, 2013 5:32 PM improved readability 2 spots
    Sunday, September 29, 2013 5:28 PM
  • John, please forgive me but you appear to be speaking theoretically, because a number of things you've said are just wrong.  But I'll give you the benefit of the doubt - SSD tech has changed very rapidly, so a lot of even recently pertinent knowledge has grown obsolete in a hurry.

    Modern SSDs work in RAID arrays without TRIM just fine, without loss of performance (this has been true for several years now).  The in-drive controllers are more sophisticated than you think.  The SSD experts will tell you this. 

    Beyond that, Intel RST (most likely to be used with modern RAID-capable SATAIII-equipped motherboards that use a chipset RAID controller) has had full TRIM support implemented for RAID 0 arrays for quite some time now.

    I'm actually doing what I suggest, practicing what I'm preaching.  I can assure you it really works - a high throughput low-latency array provides the best way to allow modern multi-core processors to stretch their legs and get a lot of work done.  The near-zero SSD latency leads to exemplary multi-tasking performance, and having plenty of free disk space on C: gives Windows all the space it needs to run well.  I am running a 4-drive array without TRIM; I still see every bit of the performance I started with 18 months ago (1.7 gigabytes/second throughput with near zero latency), and I've had zero failures (even though I'm fully backed up).  That's insane performance AND zero worry about disk space in 1.5 years of hard daily use.  The only reboots I see are from installs or Windows Updates that require them.

    Anyone who outfits a computer with electromechanical drives nowadays is trading away a TREMENDOUS amount of performance for a small price break, which includes hybrid drives.  Excellent quality SSD hardware isn't as cheap as electromechanical disks but it's not break-the-bank expensive either.  It's less than $1 / gigabyte.  Best investment I ever made in computing in my 37 year engineering career.

    Hybrids provide decreased reliability because of greatly increased complexity.  Do you want to lose your data?  Increasing complexity is a sure way to get there.

    But possibly the worst advice you've given above is to use NTFS compression for files under \Program Files.  Don't do it!  That can KILL your performance, and the compression isn't all that good anyway.  The idea is to OFFLOAD the CPU, not burden it more!

    Lastly, and you touched on it John, relocating parts of your data elsewhere using links or mount points or whatever also increases complexity and DOES lead to unexpected failures.  As you point out, some software - though it seems like such "secret" partial relocations really ought to work - just fails.  And think how it complicates things like System Image backups and Restore Points.  Don't go there.

    To create a high-performance, smooth, stable computing environment, a RAID 0 SSD array really delivers.

    Some supporting info:

     

    -Noel


    Detailed how-to in my eBooks:  

    Configure The Windows 7 "To Work" Options
    Configure The Windows 8 "To Work" Options


    Monday, September 30, 2013 9:20 AM
  • Hi David!

    Since this question is almost 5 years old, it could be useful for others rather :)

    Relocating hiberfil.sys to a different drive is quite easy. Just create a partition on the drive you would like to use for that with sufficient size and set it's TypeID to 0x84 (Hibernate). Even DiskPart - command line from Microsoft - can do that. Or you can use for example freeware MiniTool Partition Wizard.

    When you set the TypeID, you can check it in Disk Management MMC snap-in (Control Panel > System and Security > Administrative Tools > Computer Management > Disk Management). There should be Hibernate partition visible.

    But I'm not sure, if "bare" Windows supports it. However Intel Rapid Start Technology works nice with that. I'm using it exactly opposite - system is installed on HDD with SSD cache and hiberfil.sys is on it's own partition os SSD disk. Thanks to that, hibernating and waking up takes only a few seconds.

    More info:

    http://download.intel.com/support/motherboards/desktop/sb/rapid_start_technology_user_guide.pdf

    https://en.wikipedia.org/wiki/Partition_type

    Have a nice day.

    • Proposed as answer by Vickron Monday, July 28, 2014 9:08 PM
    Saturday, March 22, 2014 5:10 AM