Windows

Delete hiberfil.sys by disabling Windows Hibernate function

Hiberfil.sys can use several GB of hard disk space. Delete the file, and it will likely return. Bill Detwiler explains how to get rid of it for good.

In a previous TR Dojo Challenge question, I asked TechRepublic members, "What does hiberfil.sys do and how can you remove it?" Several members were quick to respond with the correct answer. The quickest earned some TechRepublic swag.

Hiberfil.sys and Windows Hibernate function

To understand why hiberfil.sys exists, we must look at the Windows Hibernate function. When you activate Hibernate, Windows takes a snap shot of your current session (all your running programs, open files, etc.) and writes that information to your hard drive. Hibernate was designed to speedup shut downs and restarts and save power on laptops.

Figure A

Hiberfil.sys, as the name suggests, is the file to which Windows saves the snap shot data. Thus, the file is always equal in size to the total amount of available RAM on the computer (see Figure A). On a computer with plenty of free disk space having such a large file just hanging around usually isn't a problem. But if you're running low on hard drive space and never use the Hibernate feature, hiberfil.sys is unnecessarily eating up valuable disk real estate.

Disabling Windows Hibernation

As I noted earlier, you can manually delete hiberfil.sys, but it will just come back. To permanently remove the file, you must disable the Windows Hibernate function. You can do this through either the Windows GUI or from the command line.

Windows XP

On Windows XP systems, you can easily disable Hibernate through the GUI using the following steps:

  1. Open the Control Panel and access Power Options.
  2. Select the Hibernate tab in the Power Options Properties dialog box.
  3. Clear the Enable Hibernation check box (see Figure B) and click OK.

Figure B

If you would prefer to disable Hibernate through he command line, you can use the steps outlined below.

Windows Vista and Windows 7

Completely disabling Hibernate through the GUI on Windows Vista and Windows 7 is significantly more difficult than on Windows XP. The Hibernate settings are still stored under the Control Panel's Power Options applet, but they are buried under each power plan's advanced power settings submenu. In fact, I was unable to remove hiberfil.sys by altering the appropriate Power Options (Allow hybrid sleep and Hibernate after) on either Windows Vista or Windows 7 (see Figure C).

Figure C

The only surefire method of disabling Hibernate, and thus removing hiberfil.sys, on Windows Vista and Windows 7, is through the command prompt and the following steps:

  1. Open a command prompt with administrative privileges.
  2. Enter "powercfg.exe -h off" (see Figure D).
  3. Exit the command prompt.

Figure D

As soon as you clear the check box or execute the above powercfg.exe command, Windows should delete hiberfil.sys. If not, you can manually delete it.

Re-enabling Windows Hibernate

To turn the Hibernate function back on, simply recheck the Enable Hibernation setting under Power Option Properties or enter "powercfg.exe -h on" at a command prompt with administrative privileges.

And the TechRepublic swag goes to...

This week's coffee mugs and laptop stickers go to mluck, who was first to correctly associate hiberfil.sys with Windows Hibernate function and jscholefield, who provided information on how to disable hibernation and the corresponding command line text.

Thanks to everyone who submitted an answer.

You can also sign up to receive the latest from the TR Dojo through one or more of the following methods:

About

Bill Detwiler is Managing Editor of TechRepublic and Tech Pro Research and the host of Cracking Open, CNET and TechRepublic's popular online show. Prior to joining TechRepublic in 2000, Bill was an IT manager, database administrator, and desktop supp...

48 comments
coreybryant
coreybryant

I should add that after some research, it turns out that in Windows 8 you should not delete the hibernation file if you want to keep the fast boot times.  Kernel data is written to that file regardless of hibernation settings. 

coreybryant
coreybryant

Yes, def. valid for Win 8.1.  I couldn't figure out where 30GB of my 100GB SSD went and there it is.  Hiberfil.sys...  I run 32GB of memory so it's quite large on my machine.

Warm Puppy
Warm Puppy

Great! Valid for Windows 8.1 Pro as well.

developed
developed

I've spent MANY hours, over several days, researching where all of my free space went after building a new computer system utilizing my old 160gb Intel SSD. After installing Windows 7 (via reformat) along with MS Office (not complete install); Adobe Phototshop, Acrobat, Reader, Flash Player, Firefox; my computer indicated only 17gb of available space on the SSD (C: drive)!!! OH - I only use my SSD for only OS & programs; I have a 2tb drive for "Files" and everything else. It was my Pagefile, which I reset to 2gb min to 4gb max (I have 64gb RAM!) and Hibernate, which was turned off(!), so I had to go into Administrative Command Prompt, as specified in above instructions, to turn it off. This did the trick!!! THANK YOU SO MUCH for providing this concise information!

grahame
grahame

I don't often find an article which is 100% relevant, 100% correct and 100% clear, but this was one such. Thanks!

kuklei
kuklei

Thanks for the great tip. I was wandering why the hell it wasn't deleting the file. For those of you who have more than 4GB of RAM, and want to free even more space, pagefile.sys can also be removed by not allowing memory to SWAP into HDD (system/advanced/disable Virtual Memory). Its a great spacesaver, especially for the SSD guys.

shangandrews
shangandrews

I am receiving the following error in hibernate mode.... A problem has been detected and Windows has been shut down to prevent damage to your computer. Technical information: *** STOP: 0x0000007F (0x00000000, 0x00000000, 0x0000000, 0x00000000) It doesn't matter how much memory I have, I am still receiving the same error. Does anyone have an answer?

ProfQuatermass
ProfQuatermass

Why would I want to delete it? I use Hib. every time I need to switch off my PC. It's fast at shutting down and due to Hib. it's fast at returning me to the exact state I left it. I only do a full restart if I'm installing updates or a routine chkdsk.

saifxyz
saifxyz

I like the idea, I will try it

NZJester
NZJester

I tend to disable and delete the hiberfil.sys file at least once every 6 months when I do a full and long defrag of my hard drive. After the defrag using a program that also defrags the free space into one long block I then re enable it again. I use Hibernation when I'm called away unexpectedly and am in the middle of something - that way i can turn off the computer and come back later and restart the computer right back to where I was when I was interrupted. I normally only use hibernation once every couple of months but sometimes in the holidays this can increase to once or twice a week!

santeewelding
santeewelding

In W7Pro of which I am the administrator, and I get: "You do not have permission to enable or disable the hibernate feature."

Bill Detwiler
Bill Detwiler

Hiberfil.sys can use several GB of hard disk space. Delete the file, and it will likely return. In the above article I explain how to get rid of it for good by disabling Windows Hibernate feature. As someone who doesn't use hibernate, having to disable it wasn't a sacrifice. Honestly, I've never had much luck getting hibernate to work properly. But, I'm curious if other have had better luck. Take the quick poll in the article and let me know if you use Hibernate. Original tip and poll: http://blogs.techrepublic.com.com/itdojo/?p=1493

HAL 9000
HAL 9000

Because in some situations it's more of a hindrance than a help. Some situations even require the system never to Hibernate and in situations like that there is a perfectly good reason to disable it. ;) Col

ldg29
ldg29

you must elevate permissions for cmd. type CMD in the search box, then right click on the cmd icon, choose "run as administrator", then run the command.

seanferd
seanferd

let me ask if were logged in as an Administrator at the time (hopefully not while surfing the internet), or if you used Runas to open the command prompt with admin privileges. The only other thing I could imagine is some security software jacking up the requirement to system-level privileges.

TheOnlyRick
TheOnlyRick

I like the hibernate feature, but just like anything else on a PC, sometimes it just plays up. So, I do find that every few months I need to switch it off, restart the machine, and then re-enable it. I don't like leaving my laptop or PC on if they're not being used because of the (small) savings on electricity and disk wear. Also, anything that parks the HD head is good on a laptop - it reduces the chance of destroying the HD in case lappy gets a whack. I've got an old Dell laptop which hibernates much faster than my more high-powered desktop. Plus, if taking an image over a network, it's worth disabling to reduce the image size.

oz_ollie
oz_ollie

Before disabling Hibernate make sure you change the default Vista "shutdown" button. It is brown, not red, so it automatically sends the PC/laptop into hibernate mode by default. Another tip don't resize the partition with the the hiberfil.sys file active - Windows doesn't necessarily restart after this.

jaywilpolt
jaywilpolt

Is it possible to Move hiberfil to another drive? I have an SSD drive and would still like to use the Hibernate feature. Can I move the Hiberfil to another drive? How? Thanks for all your great tips!

Lovs2look
Lovs2look

I too tried hibernation in XP SP1 and had such a horrible time with it that any PC I have now it's one of the first things to go. I prefer the extra hard disk space over a minute or two of boot time. Haven't tried this in Win7 yet, but am expecting a new PC in a couple of days (core i5...can't wait!) so will give it a go and see what transpires. Thanks for the tip, if it doesn't work out, now I know how to get rid of it permanently. Cheers,

damon.mac88
damon.mac88

Well considering the systems we have today, almost everyone has atleast 300+ Gig hdd on a system, and i dont think freeing up 3 or 4 Gb space is going to serve anything, well not much considering the fact that Hibernation is such a valuable feature, I use it atleast once a day and that is when i am going to sleep.

alexisgarcia72
alexisgarcia72

I have a Dell pc in home (Pentium D 3.0Ghz, 250GB, ATI 2900HD, DVDRW) who hibernates well with windows xp and windows vista but I cannot put this pc to sleep?or hibernate now with windows 7. Everytime I hibernate the pc, the computer restarts. Is like a nightmare, I test lot of stuff and I cannot solve the issue! :(

krhackbarth
krhackbarth

on my Dell Latitude laptop running Windows Vista and have never had a problem.

ejkolkman
ejkolkman

I'm sure this is just my nature, but I tried hibernate with my first laptop back in 98. It would crash every time when I would try to bring the machine back up. Have never trusted it since. One of the first things I do when configuring a new machine at work is disable the hibernate function.

JCitizen
JCitizen

That is necessary for some command line duties.

dacentaur
dacentaur

One should NOT be using a hard disk to that extent anyway. Any logical disk should have at least 20% to 25% of free space anyway (for defragmentation, temp file necessities during installations, etc.) If you are cramming your current drive to the gills - whatever its capacity - you should buy a larger drive. Now, whether the Hibernate feature works or not would depend on the individual system. I've tried it on several different systems and it has worked flawlessly about 99.9% of the time. Like another dude said (above) it failed to shutdown so I did a hard power-off. Except that it booted normally and did not recover from the hiberfile.sys.

ProperName
ProperName

True, I have a 500GB hard drive..., but it is partitioned into several (C - R so 16 total) 30GB chunks. All the system data goes onto C:, data goes to D:, downloads to E:, games to F:, applications to G:, H: is Temp folder, video rips are in I: etc. Thus on my system drive, I had a pretty big need to eliminate such an unneeded file to free up that 4GB of space. Not everyone keeps a single 160, 250, 500GB drive as a single partition.

ProfQuatermass
ProfQuatermass

If Hibernation is failing on you then you've got a problem with the hardware power management system in your PC. Contact Dell, see if they've got an updated driver to fix the problem? It could probably be is a symptom of a bigger problem. Hibernation works since XP SP3.

Dzmitry Z
Dzmitry Z

I must be one lucky fella, but I use the hibernate feature once a day with no problems whatsoever. Used to use it on XP Pro SP 2/3 Now use it on Win7 Ultimate. There was only one time I recall Win7 not turning the power off after dumping the memory to HD, but a power button hold fixed that. After waking the laptop up everything worked flawlessly, so I wouldn't consider this a problem... More of a glitch.

whatisnew
whatisnew

My work PC is running Win7 64-bit with hibernate enabled. I have schedule my work PC to turn on from hibernate in the morning and off (hibernated) at evening. My home PC is also running Win7 64-bit with hibernate enabled and I manually hibernate my home PC every night. Both computers are running smoothly with hibernate function. It might be a good time to take a second look with Windows 7.

necris77
necris77

Me too And i don't have a laptop and it works as crapy as well on a home pc. Computer will freeze 99% of the cases ( it started once, probably a bug).

JCitizen
JCitizen

I am late to these discussion now; maybe I'll get caught up in a week! Thanks for the post! I need slapping around a lot lately! :)

seanferd
seanferd

I was afraid I'd find out that Win 7 or an edition thereof had something horribly wrong with it. Thinking about it, I remember now that Vista and 7 both have the real administrator accounts hidden - installation does not create an administrator account for you by default, like XP and earlier versions did. But I've barely touched Vista, and it has been a while since I have used 7. I only had a test license for the beta and RC.

alexisgarcia72
alexisgarcia72

I agree, I don't see any benefits if you have too many partitions. One partition with the OS / Apps and other for data is more than enough. A Ghost image of the OS partition and regular backups of the data partition will have all the data secure and ready for recovery. Data in D can be back it up to an external HD using Beyond Compare or any Backup tool. The OS must be backed up with an Image app Like Altiris, Ghost or even W7 Image utility

TheOnlyRick
TheOnlyRick

I can't see the benefit of having a separate partition for Program Files. I think the thinking is that if you need to reinstall windows, you can do so quite easily 'cos you won't have to to reinstall all your apps. Problems is, the registry is on the C drive, and when that goes, you'll have to reinstall all your apps anyway....

Dzmitry Z
Dzmitry Z

But 16 drives sounds like a bit of an overkill. ProperName, is there any real advantage to your setup? Or is it just personal preference? Just curious...

TheOnlyRick
TheOnlyRick

Combining some of your partitions and using folders instead? What are the benefits of 16 drives? I can understand one for OS, one for data, one for backup (possibly one for the swap file and one for program files), but sixteen?? I'm sure that just creates more admininstrative work for you and your PC, plus it wastes a lot of space: 30GB for temp files? 30GB for downloads (presumably before they're filed away into a different 30GB partition)?

alexisgarcia72
alexisgarcia72

Is a best practice keep 2 ~ 3 partitions but more than 5 is not normal, not commun and not a best practice. Is better to have one partition for the OS & applications and other partition for data, email, etc. In the case of non-linear video editing, ripping, etc... is better to have a dedicated Hard drive (raid0 recommended)

ProfQuatermass
ProfQuatermass

Well if it's not compatible with Windows 7 why would you even try running it, let alone moan when it doesn't work? :-)

alexisgarcia72
alexisgarcia72

The pc is a DELL Dimmension 9150. Is an "old" pentium D (I purchased it in 2006) but is still a good hardware computer (raid 1 sata 500GBx2), 6USB and is upgraded with 4GB RAM, PCI Express Saphire HDMI HD2900 (700usd video card), 1 Bluray reader, 1 DVDRW, Logitech & Mediacenter Logitech Keyboard, 24inch Samsung Monitor (DVI), 800w PSU. Windows 2000, XP and VISTA hibernates and suspend without any issues, only Windows7 give me problems. The pc is "old" but is very very fast with the installed hardware. I'm running the Windows 7 compatibility software from MS now...

ProfQuatermass
ProfQuatermass

If your PC doesn't work correctly don't agonise about it. Contact either motherboard maker or the PC manufacturer and ask them to sort out the problem. Like any commercial product it is suppose to work when you buy it. :-)

alexisgarcia72
alexisgarcia72

My pc hibernates ok with windows xp and windows vista. Now with windows 7, i have issues with hibernation. I need to power off and power on normally, and this is a time waste and a headache. I test everything so far. I cannot suspend either. Lot of troubleshooting and time without success.

ProperName
ProperName

I have been running Windows 7 Ultimate x64 for several months now. Even though I had thought I had hibernate shut off, the computer continued to use the feature. Every morning when I got to the computer, and tried to revive it from hibernate brought about a Reset and re-boot. Utter failure again. Thanks for this tip on how to disable via the command line. Now I know it is disabled and my computer will not hibernate anymore. My laptop is also running Win7 HP and I will be fixing this issue there today also.

Editor's Picks