Unable to mount Windows (NTFS) filesystem due to hibernation

1,000,821

Solution 1

A bug has been filed about the Nautilus dialog you are seeing as it recommends a potentially dangerous option that could result in data loss. Please do not run the command in this dialog unless you want to delete your saved Windows session and potentially lose unsaved work.

Explanation: Why Linux can't open hibernated Windows partitions:

You are seeing this error because you hibernated Windows instead of turning it off the normal way (in newer versions of Windows, hibernate might be the default option).

  • Hibernating saves the current state information to the hard disk and then powers down the computer.
  • Shutting down the computer closes all programs and ends all running processes before powering down the computer.

When you turn off Windows by hibernating it, you are essentially pausing the system and saving all of that information (into a big file called hiberfil.sys) This way when you resume from hibernation all of your applications and files will be exactly how you left them. It also sets a flag in hiberfil.sys to let other Operating Systems know that Windows is hibernated.

Making changes to your Windows (ntfs) partition while it is hibernated could be dangerous--it could cause Windows to not resume from hibernation or to crash after resuming. Because of this, the tool (ntfs-3g) that mounts (opens) the partition will not mount it in read-write mode if it sees a hibernation flag. As such, Nautilus, the default file browser, will not be able to automatically open this partition--hence the error message that you see--because it is trying to open it in read-write mode.

Workaround for all versions of Windows:

There are three ways to mount a hibernated Windows partition:

  1. Boot into Windows and power down the system by shutting it down completely. You may then boot back into Ubuntu and the partition will mount in read-write mode automatically when you open it in Nautilus. Note that the "Shut Down" option may not be the one displayed in your start menu by default. You may need to click the button next to it to see further options.

  2. Manually mount the filesystem in read only mode.

    • Check to see if you have a mount point (folder for mounting your partition in) for your Windows partition in the folder /media using this command:

      ls /media

    • If you don't see a folder for your Windows partition, you should create one with the following command:

      sudo mkdir /media/windows

    • Next, mount the partition in read-only mode onto this folder with this command:

      mount -t ntfs-3g -o ro /dev/sda3 /media/windows

      Note that you should change /media/windows if your mountpoint is called something else.

    • Now you will be able to view/open files on your Windows partition using any program in Ubuntu. However you will not be able to write to the partition or modify any files as it is in read only mode.
  3. If you need to mount the partition in read-write mode and are not able to or willing to boot into Windows and shut it down completely there is a third option. However, it is not included here because it completely deletes hiberfil.sys and will cause you to lose all unsaved information in the hibernated Windows programs. The following is a quotation from man ntfs-3g about the option that would be used to do this.

    remove_hiberfile
                  Unlike in case of  read-only  mount,  the  read-write  mount  is
                  denied  if  the  NTFS  volume is hibernated. One needs either to
                  resume Windows and shutdown it  properly,  or  use  this  option
                  which  will  remove  the  Windows hibernation file. Please note,
                  this means that the saved Windows  session  will  be  completely
                  lost. Use this option under your own responsibility.
    

Solution (only for Windows 8 and 10):

There is a new feature in Windows 8 called Fast Startup. If this feature is enabled (which it is by default), Windows 8 does not actually completely shutdown when you choose shutdown. Instead, it does a "hybrid shutdown". This is something like hibernating; it makes booting Windows 8 back up faster. So, you need to disable this feature to be able to shut it down properly, and be able to mount the Windows partitions. To do this, boot into your Windows 8 and:

Note: disabling Fast Startup will most likely make your Windows 8 take a longer time to boot. There are no "exact" numbers, but let's say that if it took you 10 seconds to boot into Windows 8, it will now take you 50 seconds after disabling this feature.

  1. Open Control Panel in the small icons view and click on Power Options. (see screenshot 1)
  2. Click on Choose what the power buttons do. (see screenshot 2)
  3. Click on Change settings that are currently unavailable. (see screenshot 3)
  4. Uncheck Turn on fast startup (recommended). (see screenshot 4)

Click on Save changes. Now, shutdown Windows 8 and boot back into Ubuntu.

If you still aren't able to mount without getting errors, you may need to turn off hibernation completely. Open an elevated Command Prompt (right click on the shortcut, click on “Run as Administrator”), and input:

powercfg /h off

Source: Fast Startup - Turn On or Off in Windows 8.

Solution 2

EDIT: DOING THIS MIGHT HAVE DANGEROUS CONSEQUENCES and Windows might fail to boot or corrupt the filesystem upon booting.


Use ntfsfix in the terminal, even if you can't access Windows

sudo ntfsfix /dev/sdXY

where XY is the partition, e.g. a2 (/dev/sda2) or b1 (/dev/sdb1)

ntfsfix repairs some fundamental NTFS inconsistencies, resets the NTFS journal file and schedules an NTFS consistency check for the first boot into Windows.

Solution 3

If you want to terminate the hibernated session, run this command in a Terminal(press Ctrl+Alt+T to open Terminal)

sudo ntfsfix /dev/sdXY

where XY is the partition. ex: sda2 or sdb1

This also works if you couldn't get into Win8.

Solution 4

It's because of Windows 8's fast startup feature.

Temporary solution would be to go back in Windows and restart the system (instead of shutdown). Permanent solution is to disable fast startup.

You can use this guide to disable fast startup in Windows 8: http://itsfoss.com/solve-ntfs-mount-problem-ubuntu-windows-8-dual-boot/

Solution 5

My solution was to call a mntwindows script in /etc/rc.local. This script would check for hibernation and if hibernated mount as read only. In order to make sure the script may always be called I placed it in /bin and marked it as executable. The contents of the script are as follows

sudo mount /dev/sda[Partition Number] /media/[Any existing folder name]

#Mounts Windows
if [ $? -eq 14 ]
then
  echo "Windows is sleeping, I'm mounting as read-only"
  sudo mount -o ro /dev/sda[Partition Number] /media/[Any existing folder name]
fi
Share:
1,000,821

Related videos on Youtube

Bhumin Vadalia
Author by

Bhumin Vadalia

Updated on September 18, 2022

Comments

  • Bhumin Vadalia
    Bhumin Vadalia over 1 year

    Whenever I boot Ubuntu, I get a message that it cannot mount my windows partition, and I can choose to either wait, skip or manually mount.

    When I try to enter my Windows partition through Nautilus I get a message saying that this partition is hibernated and that I need to enter the file system and properly close it, something I have done with no problem so I don't know why this happens.

    Here's my partition table, if any more data is needed please let me know.

       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1            2048    20000767     9999360   83  Linux
    /dev/sda2        20002814   478001151   228999169    5  Extended
    /dev/sda3   *   478001152   622532607    72265728    7  HPFS/NTFS/exFAT
    /dev/sda4       622532608   625141759     1304576   82  Linux swap / Solaris
    /dev/sda5        20002816   478001151   228999168   83  Linux
    
    • hgajshb
      hgajshb over 11 years
      Do you hibernate it or do you shutdown Windows before you see the error message? I have this problem too, but I am sure I shutdown Windows 8 Release Preview instead of hibernating it. What version of Windows do you use?
  • Yuri Ghensev
    Yuri Ghensev over 10 years
    None of these works for me. The only I am able to mount Win 8 partition on ubuntu is to press "restart" in windows, then boot ubuntu.
  • Jeggy
    Jeggy about 10 years
    I Love this! :D
  • mr_azad
    mr_azad about 10 years
    Hello, I change the seatings for windows 8.1 as you mention. But unfortunately i still have the error massage I had previously. please help me,
  • Rmano
    Rmano about 10 years
    There is this link tuxera.com/community/ntfs-3g-manual/#fastrestart that could be useful --- it suggests issuing the command powercfg /h off on Windows.
  • Dave Burton
    Dave Burton about 10 years
    Note that this works even if you can't log in to Windows (e.g., due to a lost password). You can restart from the Windows Start Screen.
  • Matthew Sainsbury
    Matthew Sainsbury almost 10 years
    I believe shutdown /s /t 0 is sufficient... no need to use force
  • Kaz Wolfe
    Kaz Wolfe over 9 years
    What does this do?
  • SamB
    SamB over 9 years
    I suspect that you would not have needed to mess with powercfg if you had not disabled manual hibernation, though I could be wrong ...
  • Jendas
    Jendas over 9 years
    A little bit of explanation would be really nice :-) Certainly there is man page, but since you wrote it here, it would be good to further improve it but explaining what this command does.
  • Marco Lackovic
    Marco Lackovic over 9 years
    I tried that but it stills returns "Windows is hibernated, refused to mount. Remount failed: Operation not permitted"
  • so.very.tired
    so.very.tired over 9 years
    Nice! this should be the chosen answer...
  • Bill The Ape
    Bill The Ape over 9 years
    I am having the same exact problem as @arielnmz . I disabled "fast boot" according to the "Solution (only for Windows 8)", yet I still cannot mount it R/W in Ubuntu 14. I can mount it RO but not RW. Any idea why this works for others but not for me?
  • Bill The Ape
    Bill The Ape over 9 years
    @Matt I tried shutdown /s /t 0. This doesn't work. This is despite me disabling fast boot prior to that. I can only mount that NTFS partition RO.
  • Bill The Ape
    Bill The Ape over 9 years
    @root shutdown /f /s /t 0 doesn't work either. Something must have changed in either Ubuntu 14.04 or Windows 8.1 since this answer was posted.
  • Matthew Sainsbury
    Matthew Sainsbury over 9 years
    @BillTheApe I continue to use this technique on Arch Linux which is a rolling release. I humbly suggest that your problem lies elsewhere
  • Bill The Ape
    Bill The Ape over 9 years
    @Matt You were right. The problem indeed lied elsewhere: disabling fast startup + shutdown /f /s /t 0 was sufficient for Windows 7. It is no longer sufficient for Windows 8.1. In addition to what's required for Windows 7, Windows 8.1 requires one more step: powercfg /h off
  • Bill The Ape
    Bill The Ape over 9 years
    I am not sure fixing an NTFS partition from Ubuntu is a good idea for a hibernating fast startup Windows 8.1. Instead, I solved the problem from within Windows 8.1: powercfg /h off
  • Bill The Ape
    Bill The Ape over 9 years
    @arielnmz I solved the problem by performing one more step (in addition to the above): powercfg /h off
  • psusi
    psusi over 9 years
    You do NOT want to do this. Doing so will result in the filesystem being corrupted when you resume your hibernated windows session.
  • sage88
    sage88 almost 9 years
    This was exactly what the problem was for me and doing a restart from windows to boot into linux rather than a shutdown is a great way to verify that this is the correct solution for you. The ntfsfix solution below did not work for me, whereas this one did.
  • Fabby
    Fabby almost 9 years
    I concur with @psusi: this is very dangerous and could result in all data lost like here
  • adempewolff
    adempewolff over 8 years
    @ShahariaAzam I'll offer a bounty if you want to write up your solution here as a separate answer.
  • Shaharia Azam
    Shaharia Azam over 8 years
    @adempewolff I will. Check back soon! Here is the solution as a separate answer. askubuntu.com/questions/145902/…
  • patryk.beza
    patryk.beza over 8 years
    Note that you should umount /dev/XY before running ntfsfix.
  • Pierre Thibault
    Pierre Thibault about 8 years
    It worked for me. But GParted was not able to mount after the fix. I added back the NTFS partition in /etc/fstab (I removed it because I was not able to boot with it). I rebooted and the partition mounted without problem.
  • Fokwa Best
    Fokwa Best about 8 years
    Thanks for your solution. I would have mess things up had I not seen your post.
  • Goddard
    Goddard about 8 years
    This is a great solution if you don't want to start windows again.
  • Jose Carlos Ramos Carmenates
    Jose Carlos Ramos Carmenates almost 8 years
    Thanks,it work for my. I'm enter again and went to "restart".
  • Qwertiy
    Qwertiy almost 8 years
    What if the message appears after using reset button? Is it really needed to load windows first, or the flag can safely be dropped?
  • Coca Akat
    Coca Akat over 7 years
    It works on second method. thanks for perfect answer.
  • Peter Perháč
    Peter Perháč over 7 years
    aaaaaah! I might have known! My wife has been using this laptop! of course did not shut down anything properly, let it run out of batter power. Thanks for saving my evening
  • muru
    muru over 7 years
    This is pretty much what the section for Windows 8 and 10 in the accepted answer says.
  • Xiaodong Qi
    Xiaodong Qi over 7 years
    A detailed GUI instruction on how to turn off the fast booting option on Windows 10 can be found here. It works for me!
  • You'reAGitForNotUsingGit
    You'reAGitForNotUsingGit over 7 years
    @muru - shrugs this has screenshots
  • muru
    muru over 7 years
    shrugs meh, so does that answer - the numbers in the list are links to screenshots
  • unforgettableidSupportsMonica
    unforgettableidSupportsMonica about 7 years
    @psusi: Should this answer be edited, deleted, or just downvoted?
  • Erel Segal-Halevi
    Erel Segal-Halevi about 7 years
    I did this and got an error "Windows is hibernated, refused to mount. Remount failed: Operation not permitted"
  • Erel Segal-Halevi
    Erel Segal-Halevi about 7 years
    I did this and got an error "Windows is hibernated, refused to mount. Remount failed: Operation not permitted"
  • christianbueno.1
    christianbueno.1 almost 7 years
    thanks friend, very useful: powercfg /h off , I have been able to acces to my files on the ntfs windows 10 partition again.
  • alhelal
    alhelal over 6 years
    @adempewolff I like your answer. In my case sudo mount -t -ntfs-3g -o r o /dev/sda2 /media/ubuntu/5C04866104863DD0/ results mount: unknown filesystem type -ntfs-3g. I am trying in live CD.
  • alhelal
    alhelal over 6 years
    @adempewolff I do this for get a file that is located in window's desktop. I need nothing else of window's partition and my windows is damaged and it is not loaded.
  • 6005
    6005 over 6 years
    I have followed all of these steps before, and just recently good old Windoze reverted these settings back to turning on fast startup. Unbelievable and frustrating.
  • jonsno
    jonsno over 6 years
    Yes it works for me! My windows wasn't booting so this was the only way out :)
  • Dr_Zaszuś
    Dr_Zaszuś over 6 years
    Sometimes it is the only option when windows refuses to launch. Unless you have a windows recovery CD and you can launch chkdsk from there.
  • Ansu
    Ansu about 6 years
    I noticed that this applies not just to the system partition, but to all NTFS volumes I've had mounted in Windows. Can I mount those in RW mode, or is this whole thing a crucial precaution for every volume Windows had mounted?
  • Yannick Schneider
    Yannick Schneider about 6 years
    same issue on Windows 10
  • Owen
    Owen about 6 years
    Other than losing all your hibernated data, is there anything particularly risky about deleting the hibernation file?
  • Vladimir S.
    Vladimir S. almost 6 years
    If you are not afraid of losing the hibernated data, your command is: sudo mount -t ntfs-3g -o remove_hiberfile /dev/sdxy /mnt
  • Ian Lewis
    Ian Lewis almost 6 years
    Great solution. Many thanks. It worked for me on an ancient eMachines E442 which got accidentally trashed on shutdown. +1
  • Douglas Gaskell
    Douglas Gaskell over 5 years
    And how do you mount this if this is a HDD from a dead windows device you just want to clean up then archive?
  • ManSamVampire
    ManSamVampire almost 4 years
    I believe there is no need to create a separate mounting script in /etc/rc.local. A single line in /etc/fstab did the trick for me: /dev/sdaX /media/[mount-folder] ntfs-3g nofail,nodev,errors=remount-ro 0 0. I initially assumed errors=remount-ro is what is automatically mounting the drive as readonly if Windows is hibernated. But it also works without that option as tested on Linux Kernel 5.3+
  • Ricardo Manhães Savii
    Ricardo Manhães Savii almost 4 years
    @BillTheApe but works, in my situation, I am not able to access my windows anymore.
  • James Hirschorn
    James Hirschorn over 3 years
    I tried the remove-hiberfile option but got Metadata kept in Windows cache, refused to mount. Failed to mount '/dev/sdc2': Operation not permitted The NTFS partition is in an unsafe state. Please resume and shutdown Windows fully (no hibernation or fast restarting), or mount the volume read-only with the 'ro' mount option.
  • Grant BlahaErath
    Grant BlahaErath about 3 years
    For what it is worth, this is the solution that worked when a non-boot NTFS drive refused to mount. The system also had hibernate off, and the ntfs-3g functions like force, recover, and remove_hiberfile had no effect. My guess is attached drives must not get a good treament even when windows is ended with "shutdown /p"
  • testing_22
    testing_22 over 2 years
    I really don't remember hibernating my Windows but it indeed was the solution
  • myfirstAnswer
    myfirstAnswer about 2 years
    restarting windows instead of shuting-down solved problem also for me. ntfs-3g flag remove_hiberfile did not help.