144

I am getting an error when I try to access my NTFS drive from ubuntu.

Unable to access “My Drive”

Error mounting /dev/sda6 at /media/ubuntu/Media Center: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,dmask=0077,fmask=0177" "/dev/sda6" "/media/rolindroy/Media Center"' exited with non-zero exit status 14: The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
Failed to mount '/dev/sda6': 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

Any help would be greatly appreciated!

rolindroy
  • 1,551
  • 2
    I had this problem. It was because windows, being windows, decided to restart without asking me. When it restarts, it boots back up into linux. At that point, the drive was expecting to be restarted into windows and threw this error. – Marcel Feb 01 '16 at 02:32
  • Related: http://askubuntu.com/questions/462381/cant-mount-ntfs-drive-the-disk-contains-an-unclean-file-system – Nav Oct 20 '16 at 13:13

6 Answers6

276

If you can't access the drive, execute the following command:

sudo ntfsfix /dev/sdXY

where XY is the partition

e.g sda2 or sdb1

Then, mount with:

sudo mount -o rw /dev/sdXY /mounting point

Mounting point can be local or external drive (like a USB drive), e.g. /media/YourUserName/MountingPointName.

Artur Meinild
  • 26,018
  • 11
    This is the best solution if you can risk crashing of Windows. But for partitions other than the one on which Windows is installed, this is harmless, I think. – Devesh Khandelwal Feb 02 '15 at 17:33
  • 1
    It doesn't crash windows, not for me at least. On the far side, yes that may be a risk. – Muddassir Nazir Apr 06 '15 at 08:51
  • 1
    This error usually comes when Windows doesn't shutdown properly and you boot into Linux. – Muddassir Nazir Oct 25 '15 at 09:44
  • 2
    I try it but return Windows is hibernated, refused to mount. Remount failed: Operation not permitted – Yuseferi Dec 07 '15 at 21:29
  • 1
    @zhilevan I think you have to log into windows and shut down completely. Dont restart or hibernate. – Marcel Feb 07 '16 at 18:57
  • I have no clue what this does but it fixed my problem so thanks. – Hassan Feb 27 '17 at 22:01
  • yeap, it works but it mounts a folder with full permissions and for a magic "microsoft" reason i can't set my own permissions. What going wrong there ? – gtzinos Jun 12 '17 at 11:57
  • 1
    after sudo ntfsfix /dev/sdb1 still got +"The disk contains an unclean file system (0, 0)." +"Metadata kept in Windows cache, refused to mount." Windows did not load anymore(and before it not started) but when start from lifeCD, all partititions looks and copied - well )))) lol but true ) – Vladimir Ch Aug 29 '17 at 09:05
  • 3
    If you still get a problem after this (which is fine it's still moaning about hibernation) you can use sudo mount -t nfts-3g -o remove_hiberfile /dev/sdXY /media/Windows – Brian Sidebotham Aug 21 '18 at 14:58
  • sudo ntfsfix /dev/sdXn worked beautifully for me with fstab mount on default 0 0 options by UUID. – Fiddy Bux Jan 09 '19 at 00:46
  • Does anyone have more information on what these files do? While I'd like to seamlessly switch between Windows and Linux I'd also like to keep my data (I keep it on a secondary NTFS partition). – Paul May 06 '19 at 22:18
  • after sudo mount -o rw /dev/sdXY I receive "Mount is denied because the NTFS volume is already exclusively opened. The volume may be already mounted, or another software may use it which could be identified for example by the help of the 'fuser' command" – birdman May 24 '19 at 09:24
  • I knew it wasn't a windows installation partition and I had completely removed windows. This command fixed the problem. – absin Jul 11 '19 at 04:27
  • sudo mount -t nfts-3g -o remove_hiberfile /dev/sdXY /media/Windows as @BrianSidebotham said worked great. The problem is that windows shuts down in a "dirty" state supposedly so it can boot faster next time, which causes problems for linux to mount the file system. To avoid this problem from the windows side, shut down windows by starting a dos command prompt and typing shutdown /s – jmarina Dec 10 '23 at 09:19
58

I solved the problem with shutdown Windows by cmd

shutdown /s

This is because Windows 8 and 10 offer a "Fast Startup" option that depends on a "non-complete" shutdown

You can disable fast startup by following these steps under "Power Options"

https://itsfoss.com/solve-ntfs-mount-problem-ubuntu-windows-8-dual-boot/

abu_bua
  • 10,783
Ghazzawi
  • 597
  • 10
    For this solution, you will have to first shutdown your Linux and then boot back into Windows and then do this thing, and then again boot back into Linux. – Muddassir Nazir Oct 25 '15 at 09:45
  • 3
    Thanks! This worked for me. I wonder why this made a difference as opposed to a regular shutdown from Start --> Shutdown on Windows? – Jon Oct 17 '16 at 21:22
  • 7
    @Jon: It's because shutdown /s performs a conventional shutdown. The shutdown via the GUI performs a fast shutdown for Windows 8 & 10, where it does something that's pretty much like a hibernation, so that startup and shutdown are fast. http://askubuntu.com/questions/462381/cant-mount-ntfs-drive-the-disk-contains-an-unclean-file-system – Nav Oct 20 '16 at 13:15
  • 1
    Thanks.. This worked for me.. But why on earth windows doesn't shut down properly ? Do I have to do this every time I switch between Windows and ubuntu ? – creative Nov 23 '16 at 12:32
  • Thank You! In my case shutdown /s /f /t 0 helped – Piotr Żak Jan 30 '21 at 10:10
  • Thanks a lot! Solved my problem! I used "udisksctl mount --block-device /dev/sdXY -o rw" in Startup Application (Ubuntu 20.04) to automatically mount my ntfs drives at startup. It's always mounted as read only and I have to remount it again manually as root to read-writable, which it's very annoying.. In the end, this post described exactly the source of this problem and solved it permanently! Thumbs up! – Ingch Nov 10 '21 at 05:09
20

If you have access to booting and mounting the drive under Windows, do as the message indicates and remove it from the hibernation or fast restarting, or any other special state. You would have to do those things by booting into Windows.

You may also run chkdsk on it from Windows.

If you don't have immediate boot access under Windows for the drive, do as the message says and mount it as read only.

Then access the drive and copy the important data. You can then repair the drive under Ubuntu by reformatting the partition and bring the backed up data back.

Mounting drive as read only:

$ sudo mount -o ro /dev/[partition /media/[mounting point]

Another option is to repair the disk under Ubuntu with ntfsfix:

$ ntfsfix /dev/[partition]
L. D. James
  • 25,036
4

This is because your "Windows" system is in a intermediate state, may be its in hibernation mode or not full shutdown, try a system restart on your windows and shutdown the system fully and check the mount on your Ubuntu, it should work.

BDRSuite
  • 3,156
  • 1
  • 12
  • 11
2

This should be because your "Windows" system is in a intermediate state (not a full shutdown of system before powering off the hard drive, like using hibernation for example).

Restart on Windows, shutdown down system fully and it should work.

If you try this on a command line term session, you should have this kind of explanation

Do:

sudo mount -o ro /dev/[partition /media/[mounting point]

The output will be:

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.
Kaz Wolfe
  • 34,122
  • 21
  • 114
  • 172
Bob
  • 21
1

Log on to windows and then restart to Ubuntu. Works for me! But seriously I don't know whether there is a permanent solution to that.

ganezdragon
  • 274
  • 1
  • 3
  • 13