The hibernation file, typically named `hiberfil.sys`, is a large file on your Windows 11 computer that stores the contents of your RAM when you put your system into hibernation mode. This allows your computer to quickly resume your session exactly where you left off, rather than going through a full boot process. However, this file can take up a significant amount of disk space, sometimes several gigabytes. If you rarely use hibernation or are looking to free up space, you can safely delete this file. This guide will walk you through the process, potential pitfalls, and troubleshooting steps.

What You'll Need

  • Administrator Privileges: You'll need administrator access to your Windows 11 computer to execute the commands required.
  • Command Prompt or PowerShell: You'll be using either the Command Prompt or PowerShell to disable and delete the hibernation file.

Step-by-Step

  1. Open Command Prompt or PowerShell as Administrator: Type "cmd" or "powershell" in the Windows search bar. Right-click on the "Command Prompt" or "Windows PowerShell" result and select "Run as administrator." You’ll be prompted by User Account Control (UAC) – click "Yes" to proceed.
  2. Disable Hibernation: In the Command Prompt or PowerShell window, type the following command and press Enter:
    powercfg /hibernate off
    This command disables the hibernation feature. You will notice that the `hiberfil.sys` file will begin to disappear, although it might not be completely gone immediately. Windows often reclaims the space asynchronously.
  3. Verify Hibernation is Disabled (Optional): You can verify that hibernation is disabled by typing the following command and pressing Enter:
    powercfg /a
    This command lists the available power plans and their sleep states. If hibernation is disabled, you won’t see "Hibernation" listed.
  4. Manually Delete the Hibernation File (If Necessary): Sometimes, the `hiberfil.sys` file might not disappear immediately after disabling hibernation. If it’s still present after a few minutes, you can manually delete it. Navigate to your system drive (usually C:). You may need to show hidden files and folders to see it. To do this, open File Explorer, click on "View" in the ribbon, and check the "Hidden items" box. Once visible, right-click on `hiberfil.sys` and select "Delete." You may be prompted for administrator confirmation; click "Yes."
  5. Restart Your Computer: After disabling hibernation and deleting the `hiberfil.sys` file, it’s recommended to restart your computer to ensure the changes take effect.

Common Mistakes

  • Not Running as Administrator: The commands to disable and delete the hibernation file require administrator privileges. If you don't run Command Prompt or PowerShell as administrator, the commands will fail.
  • Deleting the Wrong File: Double-check that you are deleting the `hiberfil.sys` file and not another system file. Deleting the wrong file can cause system instability.
  • Trying to Delete the File in File Explorer Before Disabling Hibernation: Windows protects the `hiberfil.sys` file while hibernation is enabled. You’ll likely receive an error message if you try to delete it directly in File Explorer before disabling hibernation using the `powercfg` command.
  • Expecting Immediate Deletion: The `hiberfil.sys` file may not disappear immediately after disabling hibernation. Windows reclaims the space asynchronously, so it might take a few minutes for the file to be fully deleted.

Tips

  • Check Disk Space After Deletion: After deleting the hibernation file, check your disk space to confirm that the space has been freed up.
  • Re-enable Hibernation if Needed: If you later decide you want to use hibernation again, you can re-enable it by opening Command Prompt or PowerShell as administrator and typing:
    powercfg /hibernate on
    Windows will automatically create a new `hiberfil.sys` file.
  • Consider Alternatives to Hibernation: If you're concerned about disk space, consider using sleep mode instead of hibernation. Sleep mode consumes less power than hibernation but doesn't save the entire contents of your RAM to disk.
  • SSD Considerations: While deleting the hibernation file frees up space, it generally doesn't significantly impact the lifespan of a Solid State Drive (SSD). Modern SSDs have wear-leveling technology that distributes writes evenly across the drive.

Troubleshooting

  • "Access Denied" Error: This usually means you didn't run Command Prompt or PowerShell as administrator. Close the window and reopen it with administrator privileges.
  • File Still Present After Disabling: As mentioned, the `hiberfil.sys` file might not disappear immediately. Wait a few minutes and check again. If it's still there, try manually deleting it.
  • System Instability After Deletion: If you experience system instability after deleting the hibernation file, re-enable hibernation by running `powercfg /hibernate on` in an elevated Command Prompt or PowerShell window.
  • Hibernation Option Still Visible in Power Options: Even after disabling hibernation with `powercfg /hibernate off`, the "Hibernate" option might still appear in the power options menu. This is a visual artifact and doesn't necessarily mean hibernation is still active. The underlying functionality has been disabled.
  • Command Not Recognized: Ensure you have typed the command correctly, including spaces. Double-check that you are using either Command Prompt or PowerShell, not another application that might be intercepting the command.

Frequently Asked Questions

What does `hiberfil.sys` do?

The `hiberfil.sys` file stores the contents of your RAM when you put your computer into hibernation mode, allowing it to resume your session quickly.

Is it safe to delete the hibernation file?

Yes, it's generally safe to delete the hibernation file if you rarely use hibernation. However, you will lose the ability to hibernate your computer.

How much space does `hiberfil.sys` take up?

The size of `hiberfil.sys` is typically about the same as the amount of RAM your computer has. So, a computer with 16GB of RAM might have a `hiberfil.sys` file that's around 16GB.

Can I get the hibernation file back?

Yes, you can re-enable hibernation by running `powercfg /hibernate on` in an elevated Command Prompt or PowerShell window. This will recreate the `hiberfil.sys` file.

Why is my `hiberfil.sys` file so large?

The size is directly related to the amount of RAM you have installed in your computer. More RAM means a larger hibernation file.