Delete hiberfil.sys on Windows 7

18

3

Ok, so I know what hiberfil.sys is, and I want to use hibernation on my laptop.

But I have another hard drive active in my laptop, it's taken from my old one... and I want to get rid of the hiberfil.sys on that drive. But even with admin privileges I can't delete it.

Any ideas?

Baarn

Posted 2011-02-07T15:29:12.147

Reputation: 6 096

4

Possible duplicate of How to remove hiberfil.sys

– Kromster – 2016-01-17T06:58:50.080

1Closevoters: this should not be closed as a duplicate of How to remove hiberfil.sys because this post has 10x the views and almost twice the upvotes of the proposed duplicate. – nc4pk – 2016-01-19T00:40:35.543

There are zero close votes on this question, and the linked question, is closed as a duplicate of this question so this question literally cannot be closed as a duplicate of the question you point out – Ramhound – 2016-01-30T00:10:50.453

2Have you disabled hibernation when you try to delete the old hiberfil.sys? – coneslayer – 2011-02-07T16:43:55.827

Answers

24

I wanted to do this in the easiest way possible, especially without rebooting.

Open a command prompt as administrator and go to the disk where hiberfil.sys resides. In my case:

C:\Windows\System32\> e:

In e:, check for hidden files:

E:\> dir /A:H

In the listing hiberfil.sys should show up. If so, delete it:

E:\> del /AS hiberfil.sys

I have to warn you: I don't know what happens if you do this with an active hiberfil.sys file. In my case it was on an old hard disk drive and was no longer needed.

Baarn

Posted 2011-02-07T15:29:12.147

Reputation: 6 096

awesome indeed, attrib -h -r -s hiberfil.sys doesn't seem to work, however del /AS hiberfil.sys did the job for me, when trying on an unbootable Windows 10 machine from the command-line opened using Windows 10 installation media – George Birbilis – 2018-10-23T18:12:20.487

Awesome, I was afraid I'd never reclaim that space from my second drive. Couldn't use ATTRIB -S on it so was stuck. – Todd Pierzina – 2012-04-30T19:18:46.217

27

To delete restore file you can open command prompt with admin privileges and run command

powercfg -h off

Then reboot, and Windows should automatically delete your hiberfil.sys. If it doesn't, you can remove it manually.

Then running

powercfg -h on

restores sleep and hibernate functionality.

You can start command prompt with admin privileges by starting command prompt (Windows Key+R (Run), type cmd) and then right-clicking command prompt icon on task bar and selecting "Run as administrator".

Olli

Posted 2011-02-07T15:29:12.147

Reputation: 6 704

1This works! At least on Windows 7 the file is deleted immediately, without needing a restart. – Peter Mortensen – 2015-04-17T12:17:07.023

Confirm what @PeterMortensen mentioned: works without restart! – Tregoreg – 2017-04-01T00:26:02.053

4

If you really, really want to get rid of the file, you can always boot to something like a Linux or Windows PE boot disk, and then delete it.

If it was placed there by the current OS, it will come right back. However, from your wording, it sounds like it was placed on the old HD by an old OS that was on it.

Brian

Posted 2011-02-07T15:29:12.147

Reputation: 2 934

i would've done that, but there is a small problem ;) i am on a thinkpad and those laptops have a so called ultra bay, where (in normal config) your dvd-rom is located. the feature is, that you can slide your dvd-rom out and replace it with (in my case) a frame that holds a harddrive. – Baarn – 2011-02-07T16:18:56.613

What about booting to a USB device, such as a flash drive or USB DVD drive? – coneslayer – 2011-02-07T16:43:26.297

Don't do it this way. Use the method outlined by @Olli below. – None – 2011-02-07T19:19:04.733

@user3463 - Why not? – user66001 – 2014-04-14T06:18:18.013

0

For forcing remove of hibernation file and mounting it use this:

sudo mkdir /media/Windows
sudo ntfs-3g -o remove_hiberfile <device> /media/Windows
sudo umount <device>
sudo mount <device> <mountpoint>

Instead of <device> use the correct device like /dev/sda4

Update

Sorry, I don't know why, but I thought you want to mount it on linux.

So, for removing it you can use a Live-CD, like ubuntu, and execute these command above.

xdevs23

Posted 2011-02-07T15:29:12.147

Reputation: 149

2And you expect sudo, mount, umount, and /dev/sda4 to work on Windows? – Scott – 2015-10-15T18:17:06.933

-1

Right click the drive, click Properties, and go to the Security tab.

Use the Edit button to give Full control to Users and Authenticated Users.

After that, you should be able to delete the file via the command prompt (make sure that you're using the correct current directory):

del /f hiberfil.sys

That should get rid of the file. I recommend changing the permissions back afterwards.

enter image description here

Pikamander2

Posted 2011-02-07T15:29:12.147

Reputation: 279