Page 1 of 2

conflicting advice on removing hiberfile

Posted: Sat Jan 26, 2019 12:44 pm
by bucktails
I've been battling with trying to boot to Windows with that partition hibernated and I've read conflicting fixes.
The error tells me Windows is not mounted and cannot be mounted at /dev/sda4.
Here is my output from fdisk -l:

mint@mint ~ $ sudo fdisk -l
Disk /dev/loop0: 1.7 GiB, 1842749440 bytes, 3599120 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 3DE3B9C9-0D4A-11E4-8492-A3AAAC95DA86

Device Start End Sectors Size Type
/dev/sda1 2048 2099199 2097152 1G Windows recovery environment
/dev/sda2 2099200 2303999 204800 100M EFI System
/dev/sda3 2304000 2566143 262144 128M Microsoft reserved
/dev/sda4 2566144 1031587132 1029020989 490.7G Microsoft basic data
/dev/sda5 1031587840 1916651519 885063680 422G Linux filesystem
/dev/sda6 1916651520 1933264895 16613376 7.9G Linux swap
/dev/sda7 1934888960 1953524686 18635727 8.9G Windows recovery environment

Disk /dev/sdb: 14.9 GiB, 16005464064 bytes, 31260672 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x7da654e6

Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 0 3710015 3710016 1.8G 0 Empty
/dev/sdb2 3699676 3704347 4672 2.3M ef EFI (FAT-12/16/32)

I've seen "sudo ntfs-3g -o remove_hiberfile /dev/sdaX /mnt" suggested or
"sudo mkdir /media/WindowsNTFS
sudo mount -t ntfs-3g -o remove_hiberfile /dev/sdaX /media/WindowsNTFS"
among some others, all related to removing hiberfile. Then I read this article by a Windows system Administrator:
Phillip Remaker, void f()
Answered Oct 6, 2015 · Upvoted by Kelly Kinkade, Windows system administrator since 2001 · Author has 7.9k answers and 37.3m answer views

You can't mount an NTFS partition in Linux unless it has been unmounted cleanly by Windows.  Even if you could force Linux to mount it, you would be a fool to do so, since manipulating NTFS in an unknown, unsupported state is just begging for irreversible corruption.

Boot up to the Windows login screen and do a FULL shutdown, not a hybrid sleep.  From the login screen, you can do that by selecting "Shut Down" and hold SHIFT when you click it.  This will shut down the system and cleanly unmount the NTFS volume and let you manipulate it from Linux.

If you are not able to get back into that Windows installation, you probably should mount the disk on an alternate installation of Windows and clean it up from there.

Linux support for NTFS is limited.  Tread lightly when manipulating NTFS filesystems from Linux.

My question is, which is right, or has something been updated in the meantime that allows removal from inside Linux?

Thanks so much for any help.

Re: conflicting advice on removing hiberfile

Posted: Sat Jan 26, 2019 1:32 pm
by vansloneker
By default Windows 10 shuts down in semi-hibernated state. A flag is set, and therefore the partition is not writable, because this would change the situation and could cause corruption. The only way to properly shutdown Windows 10 seem to be to disable hibernate. Do so by going to the start menu, typing cmd, when it shows up in the search results right click on it and select open as administrator. Then in command window (dos-box, terminal...) type or copy and paste

Code: Select all

powercfg.exe /hibernate off
and press enter. There will be no confirmation displayed.

Re: conflicting advice on removing hiberfile

Posted: Sat Jan 26, 2019 5:06 pm
by bucktails
vansloneker wrote:
Sat Jan 26, 2019 1:32 pm
By default Windows 10 shuts down in semi-hibernated state. A flag is set, and therefore the partition is not writable, because this would change the situation and could cause corruption. The only way to properly shutdown Windows 10 seem to be to disable hibernate. Do so by going to the start menu, typing cmd, when it shows up in the search results right click on it and select open as administrator. Then in command window (dos-box, terminal...) type or copy and paste

Code: Select all

powercfg.exe /hibernate off
and press enter. There will be no confirmation displayed.
Thanks for your reply, vansloneker, but that's my problem - I can't get into windows to give that command.

Re: conflicting advice on removing hiberfile

Posted: Sat Jan 26, 2019 5:33 pm
by catweazel
bucktails wrote:
Sat Jan 26, 2019 5:06 pm
Thanks for your reply, vansloneker, but that's my problem - I can't get into windows to give that command.
sudo ntfs-3g -o remove_hiberfile /dev/sdXy /mnt

Where sdXy is the device identifier for the drive, and /mnt is the mount point. Be aware that you will lose any unsaved data in Windwoes.

Re: conflicting advice on removing hiberfile

Posted: Sat Jan 26, 2019 7:31 pm
by vansloneker
bucktails wrote:
Sat Jan 26, 2019 5:06 pm
Thanks for your reply, vansloneker, but that's my problem - I can't get into windows to give that command.
OK I missed that. So really your problem is, you can't get into Windows. When you try to boot into Windows where does it fail? Do you get to the logon screen? Or is it crashing and rebooting before that, or just freezing somewhere? Is it a dual boot with Linux?

Re: conflicting advice on removing hiberfile

Posted: Sat Jan 26, 2019 8:37 pm
by bucktails
OK I missed that. So really your problem is, you can't get into Windows. When you try to boot into Windows where does it fail? Do you get to the logon screen? Or is it crashing and rebooting before that, or just freezing somewhere? Is it a dual boot with Linux?
This is a dual boot with LM 18.3 Sylvia and Windows10 on a Toshiba Satellite L55-B, but I may have another problem. :? When I try to boot, I don't get a logon screen, but the error message "windows is hibernated, refused to mount. Operation not permitted." I've been searching for hours trying to solve that problem to no avail. I'm on a bootable thumb drive.

Re: conflicting advice on removing hiberfile

Posted: Sun Jan 27, 2019 4:04 am
by vansloneker
1. Have you tried catweazel's solution?

2. Since this is about Windows, maybe Windows repair option can help. Are you able to boot from a Windows 10 installation stick? Try option 3 from this page. Does "startup repair" bring anything useful? Can you maybe boot into "safe mode"?

If you can get at the command prompt maybe start with this.

Re: conflicting advice on removing hiberfile

Posted: Sun Jan 27, 2019 3:06 pm
by bucktails
vansloneker wrote:
Sun Jan 27, 2019 4:04 am
Have you tried catweazel's solution?
I ran catweazel's command and checked the disks after, and it showed sda4 mounted at /mnt. Then I did a controlled shutdown using the boot thumb drive and removed the boot disk as instructed. Then I rebooted without the boot disk and I got the lengthy message ending with "No bootable device - insert boot disk and press any key." I rebooted again with the boot disk and checked the disks to see if anything changed, but now sda4 shows unmounted. Looks like a circle to me!? :?:
Now, not only can't I get into Windows, I can't get into Linux either.

Re: conflicting advice on removing hiberfile

Posted: Sun Jan 27, 2019 3:57 pm
by thx-1138
...grab a Windows 10 installation cd / stick, open a command prompt with it , then run powercfg.exe /hibernate off as instructed above.

Re: conflicting advice on removing hiberfile

Posted: Sun Jan 27, 2019 4:18 pm
by DAMIEN1307
I had this problem with a toshiba satellite laptop yesterday when trying to wipe it out and install linux on it instead for a friend of mine.

once you can get into windows, follow the instructions listed in the article below to disable "fast startup", this will stop that quasi hibernation state that microsoft uses to make believe that its OS is a fast boot system...the fix is actually in the "system settings" in the windows operating system...dont forget to reboot and try again...DAMIEN

https://lifehacker.com/shutting-down-wi ... 1825532376

Re: conflicting advice on removing hiberfile

Posted: Sun Jan 27, 2019 6:07 pm
by bucktails
thx-1138 wrote:
Sun Jan 27, 2019 3:57 pm
...grab a Windows 10 installation cd / stick, open a command prompt with it , then run powercfg.exe /hibernate off as instructed above.
I'm totally embarrassed and feel really stupid, but I can't find my installation disk! :oops: Maybe I can find a friend that has one. But does this hibernation crap keep my Linux from booting, too?

Re: conflicting advice on removing hiberfile

Posted: Mon Jan 28, 2019 3:25 am
by vansloneker
bucktails wrote:
Sun Jan 27, 2019 3:06 pm
vansloneker wrote:
Sun Jan 27, 2019 4:04 am
Have you tried catweazel's solution?
I ran catweazel's command and checked the disks after, and it showed sda4 mounted at /mnt. Then I did a controlled shutdown using the boot thumb drive and removed the boot disk as instructed. Then I rebooted without the boot disk and I got the lengthy message ending with "No bootable device - insert boot disk and press any key." I rebooted again with the boot disk and checked the disks to see if anything changed, but now sda4 shows unmounted. Looks like a circle to me!? :?:
Now, not only can't I get into Windows, I can't get into Linux either.
With the boot disk do you mean an USB stick you boot from?
When you had sda4 mounted, did you look in it and see if the hiberfil.sys file was present or not?
I'm totally embarrassed and feel really stupid, but I can't find my installation disk!
It's easy to make one, if you have another working computer.
But does this hibernation crap keep my Linux from booting, too?
Not that I know. Maybe there is another problem with your your system or with the harddisk.

When your problem 1st occurred, where there any prior events? Everything worked fine and out of the blue it didn't? Or maybe there have been previous signals?
Or did you maybe run updates on Windows or Linux and after that you experienced issues?

Re: conflicting advice on removing hiberfile

Posted: Tue Jan 29, 2019 12:10 pm
by bucktails
It's easy to make one, if you have another working computer.
I tried to make one and run that command, but only got "bad command or file name"
I think something is wrong, because when I booted with the newly created Windows install thumb drive, all I got was "using US-English keyboard with US-English code page [437] and a C prompt (C:\) and can't get out. Have tried several commands, but get nowhere.
With the boot disk do you mean an USB stick you boot from?
Yes, the boot disk is a USB stick with Linux Mint 18.3
When your problem 1st occurred, where there any prior events? Everything worked fine and out of the blue it didn't? Or maybe there have been previous signals?
Or did you maybe run updates on Windows or Linux and after that you experienced issues?
I think the original problem started after I shut down the computer with the power button when I had a locked screen. I'm not sure, but I've tried so many different fixes for the different problems I've had, I don't know what caused what.

Re: conflicting advice on removing hiberfile

Posted: Wed Jan 30, 2019 5:38 am
by vansloneker
Writing a Windows ISO from Linux seem to be a bit difficult. This is best done from Windows with e.g. Rufus.

Depending on the settings a turn off by the power button may initiate a regular shutdown. I you hold the power button it will do a hard shutdown. 999 out of 1000 times the Operating system will survive that, but in rare occasions something does go wrong. Could be that it caught you.

Helping out from a distance depending on what someone explains is different from a hands on experience where you have the troubled computer in front of you.

Re: conflicting advice on removing hiberfile

Posted: Wed Jan 30, 2019 7:09 pm
by bucktails
Writing a Windows ISO from Linux seem to be a bit difficult. This is best done from Windows with e.g. Rufus.
I downloaded Rufus 3.4.1430 on my other computer that has Windows 8.1, and made a bootable USB stick, but my dual-boot computer wouldn't boot with it. I may have not done something correctly in Rufus. It recognized my USB stick, but in the next block under Boot selection, it only gives 3 options: non-bootable, MS-DOS, and FreeDOS. I chose MS-DOS. The partition scheme is BIOS (or EUFI-CSM), etc. It shows the file system as FAT32.

When I look at the USB Stick on my Linux machine, it shows it as /dev/sdb1, partitioning as Master Boot Record, partition type as a FAT32(LBA)(Bootable), with contents of FAT (32-bit version) - Mounted at /media/buck/16GB. I don't know enough to be able to tell if there's anything wrong in any of this and how it ties together. Does it matter where it is mounted? Thanks for your help. By the way, I have Secure Boot disabled.

Re: conflicting advice on removing hiberfile

Posted: Thu Jan 31, 2019 5:05 am
by vansloneker
When you enter a stick in Mint, a mountpoint gets assigned to it. This mountpoint has nothing to do with the situation of booting the computer directly from the stick.
In short, the first disk is sda, the 2nd disk is sdb. Partitions are indicated by the number: sdb1 = first partition on 2nd disk.

When booting from the stick, have you set the bios of the computer to boot from the stick 1st, or have you called the boot menu?

As far as I can tell the stick is setup correctly. I suppose you also pointed Rufus to the Windows ISO. Sometimes it helps to activate the legacy options in Rufus, but 1st make sure you do actually boot from the stick. A simple test is, disconnect the hard disk, then boot with the stick connected. Most likely it should boot from the stick if it is set to do so in the bios.

Re: conflicting advice on removing hiberfile

Posted: Thu Jan 31, 2019 10:22 pm
by bucktails
When booting from the stick, have you set the bios of the computer to boot from the stick 1st, or have you called the boot menu?
I did have BIOS set to boot from the stick first. And I did point Rufus to the Windows ISO. This is What I get:

Realtek PCIe Fe Family Controller series v1.34 (10/07/13)

CLIENT MAC ADDR: C4 54 44 E6 E0 2E GUID: 39CA3EF9-AF40-422D-B22B-46527977157F
PXE-E53: No Boot filename received

PXE-M0F: Exiting PXE ROM.
No bootable device -- insert boot disk and press any key.

Re: conflicting advice on removing hiberfile

Posted: Fri Feb 01, 2019 3:31 am
by vansloneker
It means the system is checking if it can boot from the network. You don't do that so you can disable that in the boot order. It also means it is not booting from the USB. A common issue with computers is, they will not boot from USB even if set to do so. It could be the USB has to be set 1st in hard disks under boot options. Even then, on many systems you just have to call the boot menu immediately after turning on the system and select the USB boot device.

The boot menu is called by pressing a particular key immediately after turning on the computer. As you turn it on, you start tapping that key until the menu shows. This differs per computer but often a brand uses one particular key throughout the range. On a HP chances are good it is F9. On Asus it may well be F8. Also pressing escape often calls a menu. You have to look it up in the manual, on the internet, often it is also displayed as a message during the 1st stage of the boot like press ... for BBS or boot menu.

Does the USB stick boot on your other system?

Re: conflicting advice on removing hiberfile

Posted: Fri Feb 01, 2019 3:42 am
by philotux
If it doesn't, you might want to use Window's own media creation tool to make a bootable usb. Here is a how-to:
https://www.howtogeek.com/186775/how-to ... a-legally/

Re: conflicting advice on removing hiberfile

Posted: Tue Feb 12, 2019 12:53 pm
by bucktails
...grab a Windows 10 installation cd / stick, open a command prompt with it , then run powercfg.exe /hibernate off
Here are my results:
Hibernation failed with the following error: the request is not supported.

The following items are preventing hibernation on this system.
Windows does not support Hibernate during the upgrade Process.
Windows Preinstallation Environment does not support Hibernate.